Ejemplo n.º 1
0
        public void CreateProductDto_CreatesValidDto()
        {
            var name         = "new product";
            var categoryName = "category";
            var category     = new Category
            {
                Name = categoryName
            };
            var description = "this is a brand new product";

            var product = new Product
            {
                Name        = name,
                Description = description,
                Category    = category
            };

            var dto = ProductFactory.CreateProductDto(product);

            Assert.NotNull(dto);
            Assert.Equal(name, dto.Name);
            Assert.Equal(description, dto.Description);
            Assert.Equal(categoryName, dto.Category);
        }