public void GetCharacter__WithGoodRequest() { #region Arrange var controller = new StarsWarsController(_starsWarsManager); int id = 3; #endregion #region Act var response = controller.GetCharacter(id) as OkNegotiatedContentResult <CharacterResponse>; #endregion #region Assert Assert.IsNotNull(response); Assert.IsNotNull(response.Content.Data); #endregion }
public void GetCharacter__WithNotFound() { #region Arrange var controller = new StarsWarsController(_starsWarsManager); int id = 1; #endregion #region Act var response = controller.GetCharacter(id) as NegotiatedContentResult <CharacterResponse>; #endregion #region Assert Assert.IsNotNull(response); Assert.IsNotNull(response.Content); Assert.AreEqual("Character not found", response.Content.Message); Assert.AreEqual(404, (int)response.StatusCode); #endregion }