Unit tests

In ProductService, let's make sure that our service returns product data without failure:

    namespace FlixOne.BookStore.ProductService.Tests.Services    {        public class ProductTests        {            private IEnumerable<ProductViewModel> GetProducts()            {                var productVm = new List<ProductViewModel>                {                    new ProductViewModel                    {                        CategoryId = Guid.NewGuid(),                        CategoryDescription = "Category Description",                        CategoryName = "Category Name",                        ProductDescription = "Product Description",                        ProductId = Guid.NewGuid(),                        ProductImage = "Image full path",                        ProductName = "Product Name",                        ProductPrice = 112M                    },                    new ProductViewModel                    {                        CategoryId = Guid.NewGuid(),                        CategoryDescription = "Category Description-01",                        CategoryName = "Category Name-01", ProductDescription = "Product Description-01", ...

Get Building Microservices with .NET Core now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.