Пример #1
0
        public void TestFullName()
        {
            var personVM = new TechnicalAssessment.ViewModels.PersonViewModel {
                FirstName = "John", LastName = "Doe"
            };

            Assert.IsTrue(personVM.FullName == "John Doe");
        }
Пример #2
0
        public void TestDefaultProperties()
        {
            var personVM = new TechnicalAssessment.ViewModels.PersonViewModel();

            Assert.IsNull(personVM.Address);
            Assert.IsNull(personVM.FirstName);
            Assert.IsNull(personVM.LastName);
            Assert.IsNull(personVM.ImagePath);
            Assert.IsNull(personVM.Interests);
            Assert.IsNull(personVM.Age);
            Assert.IsTrue(personVM.FullName == " ");
        }
Пример #3
0
        public void TestAge()
        {
            var person = new TechnicalAssessment.Models.Person {
                Age = 7
            };
            var personVM = new TechnicalAssessment.ViewModels.PersonViewModel(person);

            Assert.IsTrue(personVM.Age == "7");

            person.Age = null;
            personVM   = new TechnicalAssessment.ViewModels.PersonViewModel(person);
            Assert.IsTrue(personVM.Age == "N/A");
        }