예제 #1
0
        public void ValidateCustomAttribute()
        {
            _person = SamplePerson.GetSamplePerson();
              Debug.Assert(_person.Validate(), "Custom Validation failed");

              _person.Custom = "0";
              Debug.Assert(!_person.Validate(), "Custom Validation failed");
        }
예제 #2
0
        public void ValidateIdentityAttribute()
        {
            _person = SamplePerson.GetSamplePerson();

              _person.Identity = 0;
              Debug.Assert(_person.Validate(), "Identity Validation unexpected fail");

              _person.Identity = 1;
              Debug.Assert(_person.Validate(), "Identity Validation unexpected fail");
        }
예제 #3
0
        public void ValidateIntegerAttribute()
        {
            _person = SamplePerson.GetSamplePerson();

              _person.FkMother = 0;
              Debug.Assert(!_person.Validate(), "Integer Validation failed");

              _person.FkMother = 1;
              Debug.Assert(_person.Validate(), "Integer Validation unexpected fail");

              _person.FkCompany = 0;
              Debug.Assert(_person.Validate(), "Integer Validation unexpected fail");
        }
예제 #4
0
        public void ValidateStringAttribute()
        {
            _person = SamplePerson.GetSamplePerson();

              _person.Lastname = "Testname";
              Debug.Assert(_person.Validate(), "Required string check failed");

              _person.Firstname = "Something";
              Debug.Assert(_person.Validate(), "Optional string check failed");

              _person.Lastname = "";
              Debug.Assert(!_person.Validate(), "Required string check failed");

              _person.Firstname = "";
              Debug.Assert(!_person.Validate(), "Optional string check failed");

              _person.Firstname = "12345678910";
              Debug.Assert(!_person.Validate(), "String overflow failure");
        }