public void GetCountOfPages_ProvideSelectedCategory_ShouldReturnPagesCountForSelectedCategory(int pageSize, int expectedPagesCount) { // Arrange: const string SELECTED_CATEGORY = "some category"; var configurationReaderMock = new Mock <IAppConfigurationReader>(); configurationReaderMock.Setup(reader => reader.GetProductsCountPerPage()).Returns(pageSize); var selectedCategoryProducts = new List <Product> { new Product { ProductID = 1, Category = SELECTED_CATEGORY }, new Product { ProductID = 2, Category = SELECTED_CATEGORY }, new Product { ProductID = 3, Category = SELECTED_CATEGORY }, new Product { ProductID = 4, Category = SELECTED_CATEGORY }, new Product { ProductID = 5, Category = SELECTED_CATEGORY } }; var productsSelectorServiceMock = new Mock <IProductsSelectorService>(); productsSelectorServiceMock.Setup(serviceMock => serviceMock.GetProductsForSelectedCategory(SELECTED_CATEGORY)) .Returns(selectedCategoryProducts.AsQueryable()); var service = new PaginationService(productsSelectorServiceMock.Object, configurationReaderMock.Object); // Act: int result = service.GetCountOfPages(SELECTED_CATEGORY); // Assert: Assert.AreEqual(expectedPagesCount, result); }