public void GetAllCharacters__WithGoodRequest() { #region Arrange var controller = new StarsWarsController(_starsWarsManager); #endregion #region Act var response = controller.GetAllCharacters() as OkNegotiatedContentResult <CharacterResponse>; #endregion #region Assert Assert.IsNotNull(response); Assert.IsNotNull(response.Content.Data); Assert.IsNotNull(response.Content.PagingInfo); #endregion }
public void GetAllCharacters__CanPaginate() { #region Arrange var controller = new StarsWarsController(_starsWarsManager); #endregion #region Act var response = controller.GetAllCharacters() as OkNegotiatedContentResult <CharacterResponse>; #endregion #region Assert Assert.IsNotNull(response); Assert.IsNotNull(response.Content.Data); Assert.IsNotNull(response.Content.PagingInfo); Assert.IsTrue(response.Content.PagingInfo.ItemsPerPage == 4); Assert.IsTrue(response.Content.PagingInfo.TotalPages == 2); Assert.IsTrue(response.Content.PagingInfo.CurrentPage == 1); Assert.IsTrue(response.Content.PagingInfo.TotalItems == 7); #endregion }