public void TestingInitializers() { Person person = new Person("John", "Doe") { Address = testAddress1 }; Person personTwo = new Person("John", "Doe", testAddress1); Assert.AreEqual(person.FullName(), "John Doe"); Assert.AreEqual(person.FullNameProperty, "John Doe"); Assert.AreEqual(person.FullName(), personTwo.FullName()); Assert.AreEqual(person.Address, personTwo.Address); //Testing the Indexer Assert.AreEqual(person[0], "John"); //Doesn't work: //PrivatePerson privatePerson = new PrivatePerson("John", "Doe"); //PrivatePerson privatePerson = new PrivatePerson("John", "Doe", testAddress1); // Testing a static method call instance creation PrivatePerson privatePerson = PrivatePerson.CreatePrivatePerson("John", "Doe", testAddress1); Assert.AreEqual(privatePerson.FullName(), "John Doe"); }
public void T3() { PrivatePerson p = Auto.Make <PrivatePerson>(); AssertDefault(p); AssertDefault(p.Mother); AssertDefault(p.Father); }
public PrivatePersonListVM(int selectedId = -1) { PrivatePersonList = new ObservableCollection <PrivatePerson>(DataBase.ReadAll <Customers>().Where(cust => cust.TypeCustomer == true).Select(сustomers => DataBase.ToPrivatePerson(сustomers))); SelectedPrivatePerson = PrivatePersonList.SingleOrDefault(privatePerson => privatePerson.Id == selectedId); DeleteCustomer = new RelayCommand(SelectedItems => DeleteSelectedCommand(SelectedItems)); }