public void t_Person_Delete() { Person_ado personAdo = null; // backdoor data setup DbTestHelper.LoadAdoObjects(delegate(IbaUnitTestEntities iba) { personAdo = Person_ado.CreatePerson_ado(TestHelper.TestGuid1, "First Name", "Last Name", 1, 2, true, true); personAdo.EmailAddress = "asdf@adfasd"; personAdo.PhoneNumber = "(651) 646-8007"; iba.AddToPerson_ado(personAdo); }); List <Person_ado> personAdolist = DbTestHelper.LoadExtraneousPersons(); PersonMapper.Delete(new Person() { Id = personAdo.PersonId }); // Validate results using (IbaUnitTestEntities iba = new IbaUnitTestEntities()) { var PersonQuery = from Persons in iba.Person_ado select Persons; Assert.IsNotNull(PersonQuery, "Query result is null"); Assert.AreEqual(personAdolist.Count(), PersonQuery.Count(), "Wrong number of results in query"); validateExtrapersonAdos(personAdolist, PersonQuery); } }
public static void Delete(Person person) { PersonMapper.Delete(person); }