public void CreateOmbudsmanTest() { OmbudsmanRepository target = new OmbudsmanRepository(); Ombudsman.Models.Ombudsman ombudsman = new Ombudsman.Models.Ombudsman() { Name = "TestOmbudsman Created", UserName = "******", Address1 = "123 somewhere" }; var actual = target.CreateOmbudsman(ombudsman); Assert.IsTrue(actual > 0); }
public void UpdateOmbudsmanTest() { OmbudsmanRepository target = new OmbudsmanRepository(); Ombudsman.Models.Ombudsman ombudsman = target.GetOmbudsman(TestData.Ombudsman1.Value); ombudsman.Address1 = "I changed it!"; target.UpdateOmbudsman(ombudsman, false); Ombudsman.Models.Ombudsman ombudsman2 = target.GetOmbudsman(TestData.Ombudsman1.Value); Assert.AreEqual("I changed it!", ombudsman2.Address1); }
public void CreateFacilityTest() { OmbudsmanRepository target = new OmbudsmanRepository(); var facility = new Ombudsman.Models.Facility() { Name = "TestFacility 2", FacilityTypeId = 1 }; int actual; actual = target.CreateFacility(facility); Assert.IsTrue(actual > 0); }
public void UpdateOmbudsmanAuthorizedFailsTest() { OmbudsmanRepository target = new OmbudsmanRepository(); Ombudsman.Models.Ombudsman ombudsman = target.GetOmbudsman(TestData.Ombudsman1.Value); ombudsman.IsActive = !ombudsman.IsActive; var result = target.UpdateOmbudsman(ombudsman, false); Assert.IsFalse(result); }
public void UpdateOmbudsmanAuthorizedSucceedsTest() { OmbudsmanRepository target = new OmbudsmanRepository(); Ombudsman.Models.Ombudsman ombudsman = target.GetOmbudsman(TestData.Ombudsman1.Value); ombudsman.IsActive = !ombudsman.IsActive; target.UpdateOmbudsman(ombudsman, true); Ombudsman.Models.Ombudsman ombudsman2 = target.GetOmbudsman(TestData.Ombudsman1.Value); Assert.AreEqual(ombudsman.IsActive, ombudsman2.IsActive); }
public void UpdateFacilitySucceedsTest() { OmbudsmanRepository target = new OmbudsmanRepository(); Ombudsman.Models.Facility facility = target.GetFacility(TestData.Facility1.Value); facility.IsActive = !facility.IsActive; var result = target.UpdateFacility(facility, true); Assert.IsTrue(result); Ombudsman.Models.Facility facility2 = target.GetFacility(TestData.Facility1.Value); Assert.AreEqual(facility.IsActive, facility2.IsActive); }
public void UpdateFacilityTest() { OmbudsmanRepository target = new OmbudsmanRepository(); Ombudsman.Models.Facility facility = target.GetFacility(TestData.Facility1.Value); facility.Address1 = "Out of sight"; target.UpdateFacility(facility, false); Ombudsman.Models.Facility facility2 = target.GetFacility(TestData.Facility1.Value); Assert.AreEqual("Out of sight", facility2.Address1); }
public void GetOmbudsmenTest() { OmbudsmanRepository target = new OmbudsmanRepository(); List<Ombudsman.Models.Ombudsman> actual; actual = target.GetOmbudsmen(); Assert.IsTrue(actual.Count > 0); }
public void OmbudsmanRepositoryConstructorTest() { OmbudsmanRepository target = new OmbudsmanRepository(); Assert.IsNotNull(target); }
public void GetOmbudsmenByNameTest() { OmbudsmanRepository target = new OmbudsmanRepository(); string term = "testombudsman "; List<Ombudsman.Models.Ombudsman> actual; actual = target.GetOmbudsmenByName(term); Assert.IsTrue(actual.Count > 0); }
public void GetFacilityTypesTest() { OmbudsmanRepository target = new OmbudsmanRepository(); var actual = target.GetFacilityTypes(); Assert.AreEqual(3, actual.Count); }
public void GetFacilityTest() { OmbudsmanRepository target = new OmbudsmanRepository(); int id = TestData.Facility1.Value; var actual = target.GetFacility(id); Assert.AreEqual(actual.Name, "TestFacility 1"); Assert.AreEqual(actual.OmbudsmanName, "TestOmbudsman 1"); }
public void GetFacilitiesTest() { OmbudsmanRepository target = new OmbudsmanRepository(); List<Ombudsman.Models.Facility> actual; actual = target.GetFacilities(); Assert.IsTrue(actual.Count > 0); }
public void GetFacilitiesForOmbudsmanTest() { OmbudsmanRepository target = new OmbudsmanRepository(); int id = TestData.Ombudsman1.Value; var actual = target.GetFacilitiesForOmbudsman(id); Assert.AreEqual(actual.Count, 1); Assert.AreEqual(actual[0].Name, "TestFacility 1"); }