public void GetUserFail() { // Arrange ExternalService exService = new ExternalService(); UserService service = new UserService(exService); using (var _session = DBSetup()) { // Act User result = service.GetUser(_session, "users/1"); // Assert Assert.IsNull(result); } }
public void GetUser() { // Arrange ExternalService exService = new ExternalService(); UserService service = new UserService(exService); using (var _session = DBSetup()) { var userModel = new User() { FirstName = "TestFN", LastName = "TestLN", Email = "*****@*****.**", StreetAddress = "TestSA", City = "TestCity", State = "TestState", Zip = "99999" }; _session.Store(userModel); _session.SaveChanges(); // Act User result = service.GetUser(_session, "users/1"); // Assert Assert.IsNotNull(result); Assert.AreEqual(result.Id, "users/1"); Assert.AreEqual(userModel.Id, "users/1"); } }