public void Check_Person_Object() { var data = new Person(); data.FirstName = "User"; data.LastName = "Test"; data.Interests = new List<PersonInterest>(); data.Interests.Add(new PersonInterest() { Interest = "Football" }); data.Interests.Add(new PersonInterest() { Interest = "Movies" }); Assert.AreEqual("Test", data.LastName); Assert.AreEqual(2, data.Interests.Count); }
public Person GetTestPerson() { Person person = new Person(); person.PersonId = 1; person.FirstName = "James"; person.LastName = "Folland"; person.AddressId = 1; person.Addr = new Address("342 Evergreen Terrace", "Springfield", "Utah", 84441); person.DOB = new DateTime(1966, 12, 13); person.Phone = "8017731234"; person.Email = "*****@*****.**"; return person; }
public void editTest() { ActionResult result = pc.Edit(1); // NUnit.Framework.Assert.IsInstanceOf(result.GetType(), typeof(ViewResult)); var vResult = result as ViewResult; var prn = new Person(); prn.FirstName = "Bob"; prn.LastName = "Nelson"; if (vResult != null) { // Microsoft.VisualStudio.TestTools.UnitTesting.Assert.IsInstanceOfType(vResult.Model, typeof(PeopleSearch.Models.Person)); var model = vResult.Model as Person; if (model != null) { Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreEqual(prn.FirstName, model.FirstName); Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreEqual(prn.LastName, model.LastName); Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreEqual(prn.Address, model.Address); } } }
public void MarkAsModified(Person person) { }
void IPeopleSearchContext.MarkAsModified(Person person) { Entry(person).State = EntityState.Modified; }