public void GetEngTheoryItem404Test() { int id = 123; var context = A.Fake <ITKDTheoryAppContext>(); A.CallTo(() => context.GetEngTheoryItem(id)).Returns(null); var controller = new TheoryItemController(context); var result = controller.GetEngTheoryItem(id); Assert.IsInstanceOf <NotFoundResult>(result.Result); }
public void GetEngTheoryItem200Test() { int id = 123; var context = A.Fake <ITKDTheoryAppContext>(); var seedData = new SeedData(); var engTheoryItem = seedData.GetEngTheoryItem(id); A.CallTo(() => context.GetEngTheoryItem(id)).Returns(engTheoryItem); var controller = new TheoryItemController(context); var result = controller.GetEngTheoryItem(id); Assert.AreEqual(engTheoryItem, result.Value); }