public void GetEleve_ShouldNotFindEleve() { var controller = new SimpleEleveController(GetTestEleves()); var result = controller.GetEleve(999); Assert.IsInstanceOfType(result, typeof(NotFoundResult)); }
public void GetEleve_ShouldReturnCorrectEleve() { var testEleves = GetTestEleves(); var controller = new SimpleEleveController(testEleves); var result = controller.GetEleve(3) as OkNegotiatedContentResult <Eleve>; Assert.IsNotNull(result); Assert.AreEqual(testEleves[2].Nom, result.Content.Nom); }