public void GetAdmin() { var repository = new AdminList(); var newAdmin = new Admin() { Name = "Jimi Hendrix", StreetAddress = "12th Ave", City = "Minneapolis", State = "MN", ZipCode = "12446" }; var newAdminId = repository.AddAdmin(newAdmin); Assert.IsTrue(null != newAdminId, "addition fail"); var admin = repository.GetAdmin(newAdminId.Value); Assert.IsTrue(null != admin, "get new admin failed."); Assert.AreEqual(newAdmin.Name, admin.Name, "name are not equal."); Assert.AreEqual(newAdmin.StreetAddress, admin.StreetAddress, "address are not equal."); Assert.AreEqual(newAdmin.City, admin.City, "city are not equal."); Assert.AreEqual(newAdmin.State, admin.State, "state are not equal."); Assert.AreEqual(newAdmin.ZipCode, admin.ZipCode, "zip code are not equal."); var success = repository.DeleteAdmin(newAdminId.Value); Assert.IsTrue(success, "delete admin failed."); }
public void DeleteAdmin() { var repository = new AdminList(); var newAdmin = new Admin() { Name = "Jimi Hendrix", StreetAddress = "12th Ave", City = "Minneapolis", State = "MN", ZipCode = "12446" }; var newAdminId = repository.AddAdmin(newAdmin); Assert.IsTrue(null != newAdminId, "addition fail"); var admin = repository.GetAdmin(newAdminId.Value); Assert.IsTrue(null != admin, "get new admin failed."); var success = repository.DeleteAdmin(newAdminId.Value); Assert.IsTrue(success, "delete admin failed."); }