public void CustomValidationErrorMessageWithResource()
        {
            var target = new TestTarget();

            target.CustomValidationErrorMessageWithResourceProperty.Value = "";
            var errorMessage = target
                               .CustomValidationErrorMessageWithResourceProperty
                               .GetErrors(nameof(TestTarget.CustomValidationErrorMessageWithResourceProperty))
                               .Cast <string>()
                               .First();

            errorMessage.Is("Oops!? FromResource is required.");
        }
        public void CustomValidationErrorMessageWithDisplayName()
        {
            var target = new TestTarget();

            target.CustomValidationErrorMessageWithDisplayNameProperty.Value = "";
            var errorMessage = target
                               .CustomValidationErrorMessageWithDisplayNameProperty
                               .GetErrors(nameof(TestTarget.CustomValidationErrorMessageWithDisplayNameProperty))
                               .Cast <string>()
                               .First();

            errorMessage.Is("Custom validation error message for CustomName");
        }
Esempio n. 3
0
 public void Cleanup()
 {
     target = null;
 }
Esempio n. 4
0
 public void Initialize()
 {
     target = new TestTarget();
 }
 public void Cleanup()
 {
     this.target = null;
 }
 public void Initialize()
 {
     this.target = new TestTarget();
 }