8.1.1 Filtering the Product List; UNIT TEST: UPDATING EXISTING UNIT TESTS

This commit is contained in:
Jason Zhu 2021-09-08 21:27:53 +10:00
parent 4b8ce0c014
commit 7659a7b282

View File

@ -31,7 +31,7 @@ namespace SportsStore.UnitTests
ProductController controller = new ProductController(mock.Object);
controller.PageSize = 3;
// Act
ProductsListViewModel result = (ProductsListViewModel)controller.List(2).Model;
ProductsListViewModel result = (ProductsListViewModel)controller.List(null, 2).Model;
// Assert
Product[] prodArray = result.Products.ToArray();
Assert.IsTrue(prodArray.Length == 2);
@ -85,7 +85,7 @@ namespace SportsStore.UnitTests
controller.PageSize = 3;
// Act
ProductsListViewModel result = (ProductsListViewModel)controller.List(2).Model;
ProductsListViewModel result = (ProductsListViewModel)controller.List(null, 2).Model;
// Assert
PagingInfo pageInfo = result.PagingInfo;