public void GetUE_ShouldReturnWithSameID() { var context = new TestWebApiContext(); context.UserEvaluation.Add(GetDefaultUserEval()); var controller = new UserEvaluationsController(context); var result = controller.GetUserEvaluation(new Guid("07FDE199-1B05-4244-9988-517CF8F3936A")) as OkNegotiatedContentResult <UserEvaluation>; Assert.IsNotNull(result); Assert.AreEqual(new Guid("07FDE199-1B05-4244-9988-517CF8F3936A"), result.Content.CD_USEREVALUATION); }
public void GetUE_ShouldReturnAll() { var context = new TestWebApiContext(); context.UserEvaluation.Add(new UserEvaluation { DS_EMAIL = "*****@*****.**", DS_NAME = "Test User 1" }); context.UserEvaluation.Add(new UserEvaluation { DS_EMAIL = "*****@*****.**", DS_NAME = "Test User 2" }); context.UserEvaluation.Add(new UserEvaluation { DS_EMAIL = "*****@*****.**", DS_NAME = "Test User 3" }); var controller = new UserEvaluationsController(context); var result = controller.GetUserEvaluation() as TestUserEvaluationDbSet; Assert.IsNotNull(result); Assert.AreEqual(3, result.Local.Count); }