Beispiel #1
0
        public void SAStudentFullNameCompute_NameAndLastNameIsNotEmpty_ShouldBeEqualToNameAndLastName()
        {
            var student = new SAStudent(Context);

            student.Name     = "Brent";
            student.LastName = "Esh";
            Assert.AreEqual("Brent Esh", student.FullName);
        }
Beispiel #2
0
        public void SAStudentFullNameCompute_NameIsEmptyLastNameIsNotEmpty_ShouldBeEqualToLastName()
        {
            var student = new SAStudent(Context);

            student.Name     = string.Empty;
            student.LastName = "Esh";
            Assert.AreEqual("Esh", student.FullName);
        }
Beispiel #3
0
        public void SAStudentFullNameCompute_NameAndLastNameIsEmpty_ShouldBeEmpty()
        {
            var student = new SAStudent(Context);

            student.Name     = string.Empty;
            student.LastName = string.Empty;
            Assert.AreEqual(string.Empty, student.FullName);
        }
Beispiel #4
0
        public void SAStudent_FullName_Validate(SAStudent entity, ValidateEventArgs <string> e)
        {
            var result = IsFullNameValid(e.NewValue);

            if (result >= 0)
            {
                entity.Message(e, (uint)result);
            }
        }
Beispiel #5
0
 public void SAStudent_FullName_Compute(SAStudent entity, ComputeEventArgs <string> e)
 {
     e.NewValue = $"{entity.Name} {entity.LastName}";
 }