コード例 #1
0
ファイル: ContactTests.cs プロジェクト: girish66/Domain
        public void InitializedContactEmailIsEmpty()
        {
            IPerson person = new Person();
            Contact contact = new Contact(person);

            Assert.Equal(string.Empty, contact.Email);
        }
コード例 #2
0
ファイル: ContactTests.cs プロジェクト: girish66/Domain
        public void ContactsAddressSameAsPerson()
        {
            string street = "132 Street";
            string image = "test.jpg";
            IPerson person = new Person();
            person.Address = new Address();
            person.Address.City = "Somewhere";
            Contact contact = new Contact(person);

            Assert.Equal(person.Address.City, contact.Address.City);
            Assert.Equal(person.DateOfBirth, contact.DateOfBirth);
            Assert.Equal(person.Aliases, contact.Aliases);
            Assert.Equal(person.DateOfDeath, contact.DateOfDeath);
            Assert.Equal(person.Gender, contact.Gender);
            Assert.Equal(person.PrimaryName, contact.PrimaryName);
            Assert.Equal(person.TimeLine, contact.TimeLine);
            Assert.Null(contact.Image);

            contact.Address = new Address(street);
            contact.DateOfBirth = new DateTime(2012, 6, 25);
            contact.DateOfDeath = new DateTime(2012, 6, 30);
            contact.Gender = "Male";
            contact.Image = image;

            Assert.Equal(person.DateOfDeath, contact.DateOfDeath);
            Assert.Equal(person.Gender, contact.Gender);
            Assert.Equal(person.Address.Street, contact.Address.Street);
            Assert.Equal(person.DateOfBirth, contact.DateOfBirth);
            Assert.Equal(image, contact.Image);
        }
コード例 #3
0
		public AddPersonViewModel(IRepository<IContact> contactRepo)
		{
			this._contactRepo = contactRepo;

			Contact contact = new Contact(new Person());
			this.PersonPreview = new ContactViewModel(contact, this._contactRepo.Path);
			this.Caption = ViewNames.ADD_PERSON;

			this.SetupSaveCommand();
		}