예제 #1
0
        public void PersonTest_LastNameCorrect()
        {
            var person = new PersonDerived(1, "wahab", "syed");

            person.LastName = "Brown";
            Assert.Equal("Brown", person.LastName);
        }
예제 #2
0
        public void PersonTest_FirstNameCorrect()
        {
            var person = new PersonDerived(1, "wahab", "syed");

            person.FirstName = "Daniel";
            Assert.Equal("Daniel", person.FirstName);
        }
예제 #3
0
        public void PersonTest_LastNameEmpty()
        {
            var person = new PersonDerived(1);

            Assert.Throws <ArgumentNullException>(() => {
                person.LastName = "";
            });
        }
예제 #4
0
        public void PersonCreatedWithIdAndName()
        {
            var person = new PersonDerived(1, "wahab", "syed");

            Assert.Equal(1, person.Id);
            Assert.Equal("wahab", person.FirstName);
            Assert.Equal("syed", person.LastName);
        }
예제 #5
0
 public void PersonCreatedWithInvalidLastName()
 {
     Assert.Throws <ArgumentNullException>(() => {
         var person = new PersonDerived(1, "wahab", "");
     });
 }
예제 #6
0
 public void PersonCreatedWithDefaultId2()
 {
     Assert.Throws <ArgumentException>(() => {
         var person = new PersonDerived(default(long), "wahab", "syed");
     });
 }
예제 #7
0
 public void PersonCreatedWithInvalidId2()
 {
     Assert.Throws <ArgumentException>(() => {
         var person = new PersonDerived(-1, "wahab", "syed");
     });
 }
예제 #8
0
        public void PersonCreatedWithId1()
        {
            var person = new PersonDerived(1);

            Assert.Equal(1, person.Id);
        }
예제 #9
0
 public void PersonCreatedWithInvalidId()
 {
     Assert.Throws <ArgumentException>((() => {
         var person = new PersonDerived(-1);
     }));
 }
예제 #10
0
        public void PersonTest_FullName()
        {
            var person = new PersonDerived(1, "wahab", "syed");

            Assert.Equal("wahab syed", person.FullName);
        }