Пример #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");
        }