public void FindOrdersMaterializeResultsIfCustomerExist() { //Arrange var customerRepository = new StubICustomerRepository(); var productRepository = new StubIProductRepository(); var orderRepository = new StubIOrderRepository(); orderRepository.GetFilteredExpressionOfFuncOfOrderBoolean = (filter) => { var orders = new List <Order>(); var customer = new Customer(); customer.ChangeCurrentIdentity(Guid.NewGuid()); orders.Add(OrderFactory.CreateOrder(customer, "name", "city", "address", "zipcode")); return(orders); }; var salesManagement = new SalesAppService(productRepository, orderRepository, customerRepository); //act var result = salesManagement.FindOrders(Guid.NewGuid()); //Assert Assert.IsNotNull(result); Assert.IsTrue(result.Count == 1); }
public void ShouldReturnProductWithoutSubcategory() { // Arrange var product = new Product() { Class = "TestClass", Color = "TestColor", ListPrice = 9.99m, Name = "TestProduct", Id = 1, ProductNumber = "TestProductNumber", Size = "TestSize", SizeUnitMeasureCode = "FT", Style = "TestStyle", Weight = 2, WeightUnitMeasureCode = "LBS", }; var repository = new StubIProductRepository() { GetProductInt32 = productId => product }; var recommendationRepository = new StubIProductRecommendationRepository(); var controller = new ProductsController(repository, recommendationRepository); SetupControllerForTests(controller); // Act var result = controller.Get(1); var returnedProduct = new JavaScriptSerializer().Deserialize <ProductDetail>(result.Content.ReadAsStringAsync().Result); // Assert Assert.AreEqual(result.StatusCode, HttpStatusCode.OK); Assert.AreEqual(returnedProduct.Id, product.Id); }
public void FindProductsByFilterMaterializeResults() { //Arrange var customerRepository = new StubICustomerRepository(); var productRepository = new StubIProductRepository(); var orderRepository = new StubIOrderRepository(); productRepository.AllMatchingISpecificationOfProduct = (spec) => { var book = new Book("title", "description", "publisher", "isbn"); book.ChangeUnitPrice(10); book.GenerateNewIdentity(); var software = new Software("title", "description", "license code"); software.ChangeUnitPrice(10); software.GenerateNewIdentity(); return(new List <Product>() { book, software }); }; var salesManagement = new SalesAppService(productRepository, orderRepository, customerRepository); //act var result = salesManagement.FindProducts("filter text"); //Assert Assert.IsNotNull(result); Assert.IsTrue(result.Count == 2); }
public void FindProductsInPageReturnNullWhenNoData() { //Arrange var customerRepository = new StubICustomerRepository(); var orderRepository = new StubIOrderRepository(); var productRepository = new StubIProductRepository(); //productRepository.GetPagedInt32Int32ExpressionOfFuncOfProductKPropertyBoolean<string>( // (index, count, order, ascending) => { return new List<Product>(); }); productRepository.GetPagedOf1Int32Int32ExpressionOfFuncOfProductM0Boolean <string>( (index, count, order, @ascending) => new List <Product>()); //productRepository.GetPagedOf1Int32Int32ExpressionOfFuncOfProductM0Boolean<string>( // delegate(int index, int count, Expression<Func<Product, string>> order, bool ascending) // { // return new List<Product>(); // }); var salesManagement = new SalesAppService(productRepository, orderRepository, customerRepository); //act var result = salesManagement.FindProducts(0, 1); //Assert Assert.IsNull(result); }
public void FindOrdersInDateRangeMaterializeResults() { //Arrange var customerRepository = new StubICustomerRepository(); var productRepository = new StubIProductRepository(); var orderRepository = new StubIOrderRepository(); orderRepository.AllMatchingISpecificationOfOrder = (spec) => { var order = new Order(); order.GenerateNewIdentity(); order.SetTheCustomerReferenceForThisOrder(Guid.NewGuid()); return(new List <Order>() { order }); }; var salesManagement = new SalesAppService(productRepository, orderRepository, customerRepository); //act var result = salesManagement.FindOrders(DateTime.Now.AddDays(-2), DateTime.Now.AddDays(-1)); //Assert Assert.IsNotNull(result); Assert.IsTrue(result.Any()); }
public void FindOrdersInPageMaterializeResults() { //Arrange var customerRepository = new StubICustomerRepository(); var productRepository = new StubIProductRepository(); var orderRepository = new StubIOrderRepository(); //orderRepository.GetPagedInt32Int32ExpressionOfFuncOfOrderKPropertyBoolean<DateTime>( // (index, count, order, ascending) => // { // var item = new Order(); // item.GenerateNewIdentity(); // item.SetTheCustomerReferenceForThisOrder(Guid.NewGuid()); // return new List<Order>() // { // item // }; // }); orderRepository.GetPagedOf1Int32Int32ExpressionOfFuncOfOrderM0Boolean <DateTime>( FindOrdersInPageMaterializeResults); var salesManagement = new SalesAppService(productRepository, orderRepository, customerRepository); //act var result = salesManagement.FindOrders(0, 1); //Assert Assert.IsNotNull(result); Assert.IsTrue(result.Any()); }
public void AddNewOrderWithTotalGreaterCustomerCreditReturnNull() { //Arrange var productRepository = new StubIProductRepository(); var orderRepository = new StubIOrderRepository(); var customerRepository = new StubICustomerRepository(); var country = new Country("spain", "es-ES"); country.GenerateNewIdentity(); customerRepository.GetGuid = (guid) => { //default credit limit is 1000 var customer = CustomerFactory.CreateCustomer( "Jhon", "El rojo", "+34343", "company", country, new Address("city", "zipCode", "addressline1", "addressline2")); return(customer); }; orderRepository.UnitOfWorkGet = () => { var uow = new StubIUnitOfWork(); uow.Commit = () => { }; return(uow); }; orderRepository.AddOrder = (order) => { }; var salesManagement = new SalesAppService(productRepository, orderRepository, customerRepository); var dto = new OrderDto() { CustomerId = Guid.NewGuid(), ShippingAddress = "Address", ShippingCity = "city", ShippingName = "name", ShippingZipCode = "zipcode", OrderLines = new List <OrderLineDto>() { new OrderLineDto() { ProductId = Guid.NewGuid(), Amount = 1, Discount = 0, UnitPrice = 2000 } } }; //act var result = salesManagement.AddNewOrder(dto); //assert Assert.IsNull(result); }
public void ConstructorThrowExceptionIfCustomerRepositoryDependencyIsNull() { //Arrange StubICustomerRepository customerRepository = null; var orderRepository = new StubIOrderRepository(); var productRepository = new StubIProductRepository(); //Act var salesManagement = new SalesAppService(productRepository, orderRepository, customerRepository); }
public void FindProductsInPageMaterializeResults() { //Arrange var customerRepository = new StubICustomerRepository(); var productRepository = new StubIProductRepository(); var orderRepository = new StubIOrderRepository(); //productRepository.GetPagedInt32Int32ExpressionOfFuncOfProductKPropertyBoolean<string>( // (index, count, order, ascending) => // { // var book = new Book("title", "description", "publisher", "isbn"); // book.ChangeUnitPrice(10M); // book.GenerateNewIdentity(); // var software = new Software("title", "description", "license code"); // software.ChangeUnitPrice(10); // software.GenerateNewIdentity(); // return new List<Product>() // { // book, // software // }; // }); productRepository.GetPagedOf1Int32Int32ExpressionOfFuncOfProductM0Boolean <string>( (index, count, order, ascending) => { var book = new Book("title", "description", "publisher", "isbn"); book.ChangeUnitPrice(10M); book.GenerateNewIdentity(); var software = new Software("title", "description", "license code"); software.ChangeUnitPrice(10); software.GenerateNewIdentity(); return(new List <Product> { book, software }); }); var salesManagement = new SalesAppService(productRepository, orderRepository, customerRepository); //act var result = salesManagement.FindProducts(0, 2); //Assert Assert.IsNotNull(result); Assert.IsTrue(result.Count == 2); }
public void AddNewSoftwareWithNullDataThrowArgumentException() { //Arrange var customerRepository = new StubICustomerRepository(); var productRepository = new StubIProductRepository(); var orderRepository = new StubIOrderRepository(); var salesManagement = new SalesAppService(productRepository, orderRepository, customerRepository); //Act var result = salesManagement.AddNewSoftware(null); }
public void FindProductsInPageThrowExceptionWhenPageIsInvalid() { //Arrange var customerRepository = new StubICustomerRepository(); var productRepository = new StubIProductRepository(); var orderRepository = new StubIOrderRepository(); var salesManagement = new SalesAppService(productRepository, orderRepository, customerRepository); //act var resultInvalidPageIndex = salesManagement.FindProducts(-1, 1); }
public void FindOrdersInPageThrowArgumentExceptionWhenPageDataIsInvalid() { //Arrange var customerRepository = new StubICustomerRepository(); var productRepository = new StubIProductRepository(); var orderRepository = new StubIOrderRepository(); var salesManagement = new SalesAppService(productRepository, orderRepository, customerRepository); //act var resultInvalidPageIndex = salesManagement.FindOrders(-1, 1); //Assert Assert.IsNull(resultInvalidPageIndex); }
public void FindOrderReturnNullIfCustomerIdIsEmpty() { //Arrange var customerRepository = new StubICustomerRepository(); var productRepository = new StubIProductRepository(); var orderRepository = new StubIOrderRepository(); orderRepository.GetFilteredExpressionOfFuncOfOrderBoolean = (expression) => null; var salesManagement = new SalesAppService(productRepository, orderRepository, customerRepository); //act var result = salesManagement.FindOrders(Guid.Empty); //Assert Assert.IsNull(result); }
public void ShouldReturnNotFoundForProducts() { // Arrange var productRepository = new StubIProductRepository() { GetProductsInt32 = subcategoryId => null }; var recommendationRepository = new StubIProductRecommendationRepository(); var controller = new ProductsController(productRepository, recommendationRepository); SetupControllerForTests(controller); // Act var result = controller.GetProducts(1); // Assert Assert.AreEqual(result.StatusCode, HttpStatusCode.NotFound); }
public void FindOrdersInDateRangeReturnNullWhenNoData() { //Arrange var customerRepository = new StubICustomerRepository(); var productRepository = new StubIProductRepository(); var orderRepository = new StubIOrderRepository(); orderRepository.AllMatchingISpecificationOfOrder = (spec) => { return(new List <Order>()); }; var salesManagement = new SalesAppService(productRepository, orderRepository, customerRepository); //act var result = salesManagement.FindOrders(DateTime.Now.AddDays(-2), DateTime.Now.AddDays(+2)); //Assert Assert.IsNull(result); }
public void FindOrdersWithInvalidPageIndexThrowException() { //Arrange var customerRepository = new StubICustomerRepository(); var productRepository = new StubIProductRepository(); var orderRepository = new StubIOrderRepository(); //orderRepository.GetPagedInt32Int32ExpressionOfFuncOfOrderKPropertyBoolean<DateTime>( // (index, count, order, ascending) => { return new List<Order>(); }); orderRepository.GetPagedOf1Int32Int32ExpressionOfFuncOfOrderM0Boolean<DateTime>( FindOrdersWithInvalidPageIndexThrowException); var salesManagement = new SalesAppService(productRepository, orderRepository, customerRepository); //act var result = salesManagement.FindOrders(-1, 1); }
public void FindOrdersWithInvalidPageIndexThrowException() { //Arrange var customerRepository = new StubICustomerRepository(); var productRepository = new StubIProductRepository(); var orderRepository = new StubIOrderRepository(); //orderRepository.GetPagedInt32Int32ExpressionOfFuncOfOrderKPropertyBoolean<DateTime>( // (index, count, order, ascending) => { return new List<Order>(); }); orderRepository.GetPagedOf1Int32Int32ExpressionOfFuncOfOrderM0Boolean <DateTime>( FindOrdersWithInvalidPageIndexThrowException); var salesManagement = new SalesAppService(productRepository, orderRepository, customerRepository); //act var result = salesManagement.FindOrders(-1, 1); }
public void AddNewBookReturnAddedBook() { //Arrange var customerRepository = new StubICustomerRepository(); var orderRepository = new StubIOrderRepository(); var productRepository = new StubIProductRepository(); productRepository.UnitOfWorkGet = () => { var uow = new StubIUnitOfWork(); uow.Commit = () => { }; return(uow); }; productRepository.AddProduct = (product) => { }; var salesManagement = new SalesAppService(productRepository, orderRepository, customerRepository); var dto = new BookDto() { Title = "The title", Description = "description", Publisher = "license", Isbn = "isbn", AmountInStock = 10, UnitPrice = 10 }; //Act var result = salesManagement.AddNewBook(dto); //Assert Assert.IsNotNull(result); Assert.IsTrue(result.Id != Guid.Empty); Assert.AreEqual(result.Title, dto.Title); Assert.AreEqual(result.Description, dto.Description); Assert.AreEqual(result.Publisher, dto.Publisher); Assert.AreEqual(result.Isbn, dto.Isbn); Assert.AreEqual(result.AmountInStock, dto.AmountInStock); Assert.AreEqual(result.UnitPrice, dto.UnitPrice); }
public void AddNewOrderWithoutCustomerIdThrowArgumentException() { //Arrange var customerRepository = new StubICustomerRepository(); var productRepository = new StubIProductRepository(); var orderRepository = new StubIOrderRepository(); var salesManagement = new SalesAppService(productRepository, orderRepository, customerRepository); var order = new OrderDto() // order is not valid when customer id is empty { CustomerId = Guid.Empty }; //act var result = salesManagement.AddNewOrder(order); //assert Assert.IsNull(result); }
public void AddNewSoftwareThrowExceptionWhenDataIsInvalid() { //Arrange var customerRepository = new StubICustomerRepository(); var productRepository = new StubIProductRepository(); var orderRepository = new StubIOrderRepository(); var salesManagement = new SalesAppService(productRepository, orderRepository, customerRepository); var dto = new SoftwareDto() { Title = "The title", Description = "the description", LicenseCode = "license", AmountInStock = 10, UnitPrice = -1 //this is a not valid value }; //Act var result = salesManagement.AddNewSoftware(dto); }
public void ShouldAddAnItemToANewCart() { // Arrange var targetShoppingCartSaved = false; var cartRepository = new StubIShoppingCartRepository { SaveShoppingCartShoppingCart = (cart) => { targetShoppingCartSaved = true; return(cart); } }; var productRepository = new StubIProductRepository { ProductExistsInt32 = productId => productId.Equals(1) }; var controller = new CartController(cartRepository, productRepository); SetupControllerForTests(controller); // Act var result = controller.Add(new CartItem { ProductId = 1, ProductName = "Test Product", ProductPrice = 9.99m, Quantity = 1 }); // Assert Assert.IsTrue(targetShoppingCartSaved); Assert.AreEqual(result.StatusCode, HttpStatusCode.Created); }
public void FindOrdersInPageMaterializeResults() { //Arrange var customerRepository = new StubICustomerRepository(); var productRepository = new StubIProductRepository(); var orderRepository = new StubIOrderRepository(); //orderRepository.GetPagedInt32Int32ExpressionOfFuncOfOrderKPropertyBoolean<DateTime>( // (index, count, order, ascending) => // { // var item = new Order(); // item.GenerateNewIdentity(); // item.SetTheCustomerReferenceForThisOrder(Guid.NewGuid()); // return new List<Order>() // { // item // }; // }); orderRepository.GetPagedOf1Int32Int32ExpressionOfFuncOfOrderM0Boolean<DateTime>( FindOrdersInPageMaterializeResults); var salesManagement = new SalesAppService(productRepository, orderRepository, customerRepository); //act var result = salesManagement.FindOrders(0, 1); //Assert Assert.IsNotNull(result); Assert.IsTrue(result.Any()); }
public void FindOrdersMaterializeResultsIfCustomerExist() { //Arrange var customerRepository = new StubICustomerRepository(); var productRepository = new StubIProductRepository(); var orderRepository = new StubIOrderRepository(); orderRepository.GetFilteredExpressionOfFuncOfOrderBoolean = (filter) => { var orders = new List<Order>(); var customer = new Customer(); customer.ChangeCurrentIdentity(Guid.NewGuid()); orders.Add(OrderFactory.CreateOrder(customer, "name", "city", "address", "zipcode")); return orders; }; var salesManagement = new SalesAppService(productRepository, orderRepository, customerRepository); //act var result = salesManagement.FindOrders(Guid.NewGuid()); //Assert Assert.IsNotNull(result); Assert.IsTrue(result.Count == 1); }
public void FindOrdersInDateRangeReturnNullWhenNoData() { //Arrange var customerRepository = new StubICustomerRepository(); var productRepository = new StubIProductRepository(); var orderRepository = new StubIOrderRepository(); orderRepository.AllMatchingISpecificationOfOrder = (spec) => { return new List<Order>(); }; var salesManagement = new SalesAppService(productRepository, orderRepository, customerRepository); //act var result = salesManagement.FindOrders(DateTime.Now.AddDays(-2), DateTime.Now.AddDays(+2)); //Assert Assert.IsNull(result); }
public void ShouldSaveOrder() { // Arrange var personGuid = Guid.NewGuid(); var orderInfo = new OrderInfo() { BillingAddressId = 1, CartId = personGuid.ToString(), CreditCardId = 1, ShippingAddressId = 1 }; var person = new Person() { Id = 1 }; person.AddAddress(new Address { Id = 1, AddressLine1 = "street 1234", City = "city", PostalCode = "1001" }); person.AddCreditCard(new CreditCard { Id = 1, CardType = "card", CardNumber = "1234567890123456", ExpMonth = 11, ExpYear = 2019 }); var address = new Address() { Id = 1 }; var creditCard = new CreditCard() { Id = 1 }; var shoppingCartItem = new ShoppingCartItem() { ProductId = 1, ProductName = "Test Product", ProductPrice = 1, Quantity = 1 }; var shoppingCart = new ShoppingCart("1"); shoppingCart.AddItem(shoppingCartItem); var inventoryService = new StubIInventoryService { InventoryAndPriceCheckShoppingCart = shoppingCartToCheck => false }; var personRepository = new StubIPersonRepository { GetPersonGuid = personId => person, }; var shoppingCartRepository = new StubIShoppingCartRepository { GetShoppingCartString = shoppingCartId => shoppingCart }; var productRepository = new StubIProductRepository { GetProductInt32 = productId => new Product() { Id = productId } }; var controller = new OrdersController( new StubIOrderHistoryRepository(), shoppingCartRepository, personRepository, productRepository, new StubIOrderService(), inventoryService); SetupControllerForTests(controller); // Act var response = controller.Post(orderInfo); // Assert Assert.AreEqual(HttpStatusCode.Created, response.StatusCode); }
public void AddNewSoftwareReturnAddedSoftware() { //Arrange var customerRepository = new StubICustomerRepository(); var orderRepository = new StubIOrderRepository(); var productRepository = new StubIProductRepository(); productRepository.UnitOfWorkGet = () => { var uow = new StubIUnitOfWork(); uow.Commit = () => { }; return uow; }; productRepository.AddProduct = (product) => { }; var salesManagement = new SalesAppService(productRepository, orderRepository, customerRepository); var dto = new SoftwareDto() { Title = "The title", Description = "description", LicenseCode = "license code", AmountInStock = 10, UnitPrice = 10 }; //Act var result = salesManagement.AddNewSoftware(dto); //Assert Assert.IsNotNull(result); Assert.IsTrue(result.Id != Guid.Empty); Assert.AreEqual(result.Title, dto.Title); Assert.AreEqual(result.Description, dto.Description); Assert.AreEqual(result.LicenseCode, dto.LicenseCode); Assert.AreEqual(result.AmountInStock, dto.AmountInStock); Assert.AreEqual(result.UnitPrice, dto.UnitPrice); }
public void FindOrdersInDateRangeMaterializeResults() { //Arrange var customerRepository = new StubICustomerRepository(); var productRepository = new StubIProductRepository(); var orderRepository = new StubIOrderRepository(); orderRepository.AllMatchingISpecificationOfOrder = (spec) => { var order = new Order(); order.GenerateNewIdentity(); order.SetTheCustomerReferenceForThisOrder(Guid.NewGuid()); return new List<Order>() { order }; }; var salesManagement = new SalesAppService(productRepository, orderRepository, customerRepository); //act var result = salesManagement.FindOrders(DateTime.Now.AddDays(-2), DateTime.Now.AddDays(-1)); //Assert Assert.IsNotNull(result); Assert.IsTrue(result.Any()); }
public void AddNewBookThrowExceptionWhenDataIsInvalid() { //Arrange var customerRepository = new StubICustomerRepository(); var productRepository = new StubIProductRepository(); var orderRepository = new StubIOrderRepository(); var salesManagement = new SalesAppService(productRepository, orderRepository, customerRepository); var dto = new BookDto() { Title = "The title", Description = "description", Publisher = "license", Isbn = "isbn", AmountInStock = 10, UnitPrice = -1 //this is a not valid value }; //Act var result = salesManagement.AddNewBook(dto); }
public void AddNewOrderWithTotalGreaterCustomerCreditReturnNull() { //Arrange var productRepository = new StubIProductRepository(); var orderRepository = new StubIOrderRepository(); var customerRepository = new StubICustomerRepository(); var country = new Country("spain", "es-ES"); country.GenerateNewIdentity(); customerRepository.GetGuid = (guid) => { //default credit limit is 1000 var customer = CustomerFactory.CreateCustomer( "Jhon", "El rojo", "+34343", "company", country, new Address("city", "zipCode", "addressline1", "addressline2")); return customer; }; orderRepository.UnitOfWorkGet = () => { var uow = new StubIUnitOfWork(); uow.Commit = () => { }; return uow; }; orderRepository.AddOrder = (order) => { }; var salesManagement = new SalesAppService(productRepository, orderRepository, customerRepository); var dto = new OrderDto() { CustomerId = Guid.NewGuid(), ShippingAddress = "Address", ShippingCity = "city", ShippingName = "name", ShippingZipCode = "zipcode", OrderLines = new List<OrderLineDto>() { new OrderLineDto() { ProductId = Guid.NewGuid(), Amount = 1, Discount = 0, UnitPrice = 2000 } } }; //act var result = salesManagement.AddNewOrder(dto); //assert Assert.IsNull(result); }
public void AddNewBookWithNullDataThrowArgumentException() { //Arrange var customerRepository = new StubICustomerRepository(); var productRepository = new StubIProductRepository(); var orderRepository = new StubIOrderRepository(); var salesManagement = new SalesAppService(productRepository, orderRepository, customerRepository); //Act var result = salesManagement.AddNewBook(null); //Assert Assert.IsNull(result); }
public void FindProductsByFilterMaterializeResults() { //Arrange var customerRepository = new StubICustomerRepository(); var productRepository = new StubIProductRepository(); var orderRepository = new StubIOrderRepository(); productRepository.AllMatchingISpecificationOfProduct = (spec) => { var book = new Book("title", "description", "publisher", "isbn"); book.ChangeUnitPrice(10); book.GenerateNewIdentity(); var software = new Software("title", "description", "license code"); software.ChangeUnitPrice(10); software.GenerateNewIdentity(); return new List<Product>() { book, software }; }; var salesManagement = new SalesAppService(productRepository, orderRepository, customerRepository); //act var result = salesManagement.FindProducts("filter text"); //Assert Assert.IsNotNull(result); Assert.IsTrue(result.Count == 2); }
public void FindProductsInPageMaterializeResults() { //Arrange var customerRepository = new StubICustomerRepository(); var productRepository = new StubIProductRepository(); var orderRepository = new StubIOrderRepository(); //productRepository.GetPagedInt32Int32ExpressionOfFuncOfProductKPropertyBoolean<string>( // (index, count, order, ascending) => // { // var book = new Book("title", "description", "publisher", "isbn"); // book.ChangeUnitPrice(10M); // book.GenerateNewIdentity(); // var software = new Software("title", "description", "license code"); // software.ChangeUnitPrice(10); // software.GenerateNewIdentity(); // return new List<Product>() // { // book, // software // }; // }); productRepository.GetPagedOf1Int32Int32ExpressionOfFuncOfProductM0Boolean<string>( (index, count, order, ascending) => { var book = new Book("title", "description", "publisher", "isbn"); book.ChangeUnitPrice(10M); book.GenerateNewIdentity(); var software = new Software("title", "description", "license code"); software.ChangeUnitPrice(10); software.GenerateNewIdentity(); return new List<Product> { book, software }; }); var salesManagement = new SalesAppService(productRepository, orderRepository, customerRepository); //act var result = salesManagement.FindProducts(0, 2); //Assert Assert.IsNotNull(result); Assert.IsTrue(result.Count == 2); }
public void FindProductsInPageReturnNullWhenNoData() { //Arrange var customerRepository = new StubICustomerRepository(); var orderRepository = new StubIOrderRepository(); var productRepository = new StubIProductRepository(); //productRepository.GetPagedInt32Int32ExpressionOfFuncOfProductKPropertyBoolean<string>( // (index, count, order, ascending) => { return new List<Product>(); }); productRepository.GetPagedOf1Int32Int32ExpressionOfFuncOfProductM0Boolean<string>( (index, count, order, @ascending) => new List<Product>()); //productRepository.GetPagedOf1Int32Int32ExpressionOfFuncOfProductM0Boolean<string>( // delegate(int index, int count, Expression<Func<Product, string>> order, bool ascending) // { // return new List<Product>(); // }); var salesManagement = new SalesAppService(productRepository, orderRepository, customerRepository); //act var result = salesManagement.FindProducts(0, 1); //Assert Assert.IsNull(result); }