2 // ValidationAttributeTest.cs
5 // Marek Habersack <mhabersack@novell.com>
7 // Copyright (C) 2010 Novell, Inc. (http://novell.com/)
9 // Permission is hereby granted, free of charge, to any person obtaining
10 // a copy of this software and associated documentation files (the
11 // "Software"), to deal in the Software without restriction, including
12 // without limitation the rights to use, copy, modify, merge, publish,
13 // distribute, sublicense, and/or sell copies of the Software, and to
14 // permit persons to whom the Software is furnished to do so, subject to
15 // the following conditions:
17 // The above copyright notice and this permission notice shall be
18 // included in all copies or substantial portions of the Software.
20 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
23 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
24 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
25 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
26 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 using System.Collections.Generic;
30 using System.ComponentModel.DataAnnotations;
33 using NUnit.Framework;
34 using MonoTests.Common;
36 namespace MonoTests.System.ComponentModel.DataAnnotations
39 public class ValidationAttributeTest
41 const string TEST_ERROR_MESSAGE = "Test Error Message";
42 string ErrorMessageAccessor ()
44 return TEST_ERROR_MESSAGE;
48 public void Constructor ()
50 var attr = new ValidateFooAttribute ();
52 Assert.IsNull (attr.ErrorMessage, "#A1");
53 Assert.IsNull (attr.ErrorMessageResourceName, "#A2");
54 Assert.IsNull (attr.ErrorMessageResourceType, "#A3");
55 Assert.IsNotNull (attr.GetErrorMessageString (), "#A4");
59 public void Constructor_Func ()
61 var attr = new ValidateFooAttribute (ErrorMessageAccessor);
63 Assert.IsNull (attr.ErrorMessage, "#A1");
64 Assert.IsNull (attr.ErrorMessageResourceName, "#A2");
65 Assert.IsNull (attr.ErrorMessageResourceType, "#A3");
66 Assert.IsNotNull (attr.GetErrorMessageString (), "#A4");
67 Assert.AreEqual (TEST_ERROR_MESSAGE, attr.GetErrorMessageString (), "#A4");
71 public void Constructor_String ()
73 var attr = new ValidateFooAttribute ("Another Test Error Message");
75 Assert.IsNull (attr.ErrorMessage, "#A1");
76 Assert.IsNull (attr.ErrorMessageResourceName, "#A2");
77 Assert.IsNull (attr.ErrorMessageResourceType, "#A3");
78 Assert.IsNotNull (attr.GetErrorMessageString (), "#A4");
79 Assert.IsNotNull (attr.GetErrorMessageString (), "#A4-1");
80 Assert.AreEqual ("Another Test Error Message", attr.GetErrorMessageString (), "#A4-2");
84 public void ErrorMessage ()
86 var attr = new ValidateFooAttribute ();
88 Assert.IsNull (attr.ErrorMessage, "#A1");
90 attr.ErrorMessage = "Test";
91 Assert.AreEqual ("Test", attr.ErrorMessage, "#A2");
93 attr.ErrorMessage = String.Empty;
94 Assert.AreEqual (String.Empty, attr.ErrorMessage, "#A3");
96 attr.ErrorMessage = null;
97 Assert.IsNull (attr.ErrorMessage, "#A4");
100 attr.ErrorMessage = String.Empty;
102 } catch (InvalidOperationException) {
106 attr = new ValidateFooAttribute ("Test");
108 attr.ErrorMessage = null;
110 } catch (ArgumentException) {
114 attr = new ValidateFooAttribute ("Test");
116 attr.ErrorMessage = String.Empty;
118 } catch (ArgumentException) {
122 attr = new ValidateFooAttribute ();
123 attr.ErrorMessageResourceName = "ErrorProperty1";
126 attr.ErrorMessage = "Test Message";
128 } catch (InvalidOperationException) {
136 public void ErrorMessageResourceName ()
138 var attr = new ValidateFooAttribute ();
140 Assert.IsNull (attr.ErrorMessageResourceName, "#A1");
142 attr.ErrorMessageResourceName = "Test";
143 Assert.IsNotNull (attr.ErrorMessageResourceName, "#A2-1");
144 Assert.AreEqual ("Test", attr.ErrorMessageResourceName, "#A2-2");
146 attr.ErrorMessageResourceName = String.Empty;
147 Assert.IsNotNull (attr.ErrorMessageResourceName, "#A3-1");
148 Assert.AreEqual (String.Empty, attr.ErrorMessageResourceName, "#A3-2");
150 attr.ErrorMessageResourceName = null;
151 Assert.IsNull (attr.ErrorMessageResourceName, "#A3-1");
154 attr.ErrorMessageResourceName = String.Empty;
155 Assert.Fail ("#A3-1");
156 } catch (InvalidOperationException) {
160 attr = new ValidateFooAttribute ("Test");
162 attr.ErrorMessageResourceName = String.Empty;
163 Assert.Fail ("#A3-2");
164 } catch (ArgumentException) {
168 attr = new ValidateFooAttribute ("Test");
170 attr.ErrorMessageResourceName = null;
171 Assert.Fail ("#A3-3");
172 } catch (ArgumentException) {
176 attr = new ValidateFooAttribute ();
177 attr.ErrorMessageResourceType = typeof (FooErrorMessageProvider);
180 attr.ErrorMessageResourceName = "NoSuchProperty";
181 Assert.Fail ("#A3-4");
182 } catch (InvalidOperationException) {
189 public void ErrorMessageResourceType ()
191 var attr = new ValidateFooAttribute ();
193 Assert.IsNull (attr.ErrorMessageResourceType, "#A1");
195 attr.ErrorMessageResourceType = typeof (FooErrorMessageProvider);
196 Assert.IsNotNull (attr.ErrorMessageResourceType, "#A2-1");
197 Assert.AreEqual (typeof (FooErrorMessageProvider), attr.ErrorMessageResourceType, "#A2-2");
199 attr = new ValidateFooAttribute ();
200 attr.ErrorMessageResourceName = "NoSuchProperty";
203 attr.ErrorMessageResourceType = typeof (FooErrorMessageProvider);
205 } catch (InvalidOperationException) {
212 public void ErrorMessageString ()
214 var attr = new ValidateFooAttribute ();
216 Assert.IsNotNull (attr.GetErrorMessageString (), "#A1-1");
217 Assert.IsTrue (attr.GetErrorMessageString ().Length > 0, "#A1-2");
219 attr = new ValidateFooAttribute ();
220 attr.ErrorMessageResourceName = "TestResource";
222 attr.GetErrorMessageString ();
223 Assert.Fail ("#A2-1");
224 } catch (InvalidOperationException) {
228 attr = new ValidateFooAttribute ();
229 attr.ErrorMessageResourceName = String.Empty;
231 attr.GetErrorMessageString ();
232 Assert.Fail ("#A2-1");
233 } catch (InvalidOperationException) {
237 attr = new ValidateFooAttribute ();
238 attr.ErrorMessageResourceType = typeof (FooErrorMessageProvider);
239 attr.ErrorMessageResourceName = null;
242 attr.GetErrorMessageString ();
243 Assert.Fail ("#A3-1");
244 } catch (InvalidOperationException) {
248 attr = new ValidateFooAttribute ();
249 attr.ErrorMessageResourceName = String.Empty;
250 attr.ErrorMessageResourceType = typeof (FooErrorMessageProvider);
252 string s = attr.GetErrorMessageString ();
253 Assert.Fail ("#A3-2");
254 } catch (InvalidOperationException) {
258 attr = new ValidateFooAttribute ();
259 attr.ErrorMessageResourceName = "NoSuchProperty";
260 attr.ErrorMessageResourceType = typeof (FooErrorMessageProvider);
262 attr.GetErrorMessageString ();
264 } catch (InvalidOperationException) {
268 attr = new ValidateFooAttribute ();
269 attr.ErrorMessageResourceName = "ErrorProperty2";
270 attr.ErrorMessageResourceType = typeof (FooErrorMessageProvider);
272 attr.GetErrorMessageString ();
274 } catch (InvalidOperationException) {
278 attr = new ValidateFooAttribute ();
279 attr.ErrorMessageResourceName = "ErrorProperty3";
280 attr.ErrorMessageResourceType = typeof (FooErrorMessageProvider);
282 attr.GetErrorMessageString ();
284 } catch (InvalidOperationException) {
288 attr = new ValidateFooAttribute ();
289 attr.ErrorMessageResourceName = "ErrorProperty4";
290 attr.ErrorMessageResourceType = typeof (FooErrorMessageProvider);
292 attr.GetErrorMessageString ();
294 } catch (InvalidOperationException) {
298 attr = new ValidateFooAttribute ();
299 attr.ErrorMessageResourceName = "ErrorProperty5";
300 attr.ErrorMessageResourceType = typeof (FooErrorMessageProvider);
302 attr.GetErrorMessageString ();
304 } catch (InvalidOperationException) {
308 attr = new ValidateFooAttribute ();
309 attr.ErrorMessageResourceName = "ErrorField1";
310 attr.ErrorMessageResourceType = typeof (FooErrorMessageProvider);
312 attr.GetErrorMessageString ();
314 } catch (InvalidOperationException) {
318 attr = new ValidateFooAttribute ();
319 attr.ErrorMessageResourceName = "ErrorField2";
320 attr.ErrorMessageResourceType = typeof (FooErrorMessageProvider);
322 attr.GetErrorMessageString ();
324 } catch (InvalidOperationException) {
329 attr = new ValidateFooAttribute ();
330 attr.ErrorMessageResourceName = "ErrorProperty1";
331 attr.ErrorMessageResourceType = typeof (FooErrorMessageProvider);
332 Assert.IsNotNull (attr.GetErrorMessageString (), "#C1-1");
333 Assert.AreEqual ("Error Message 1", attr.GetErrorMessageString (), "#C1-2");
335 attr = new ValidateFooAttribute (ErrorMessageAccessor);
336 Assert.IsNotNull (attr.GetErrorMessageString (), "#D1-1");
337 Assert.AreEqual (TEST_ERROR_MESSAGE, attr.GetErrorMessageString (), "#D1-2");
339 attr = new ValidateFooAttribute ();
340 attr.ErrorMessageResourceName = "ErrorProperty1";
341 attr.ErrorMessageResourceType = typeof (FooErrorMessageProvider);
342 Assert.IsNotNull (attr.GetErrorMessageString (), "#D1-3");
343 Assert.AreEqual ("Error Message 1", attr.GetErrorMessageString (), "#D1-4");
345 attr.ErrorMessage = "Test Message";
347 attr.GetErrorMessageString ();
349 } catch (InvalidOperationException) {
356 public void FormatErrorMessage ()
358 var attr = new ValidateFooAttribute ();
360 Assert.IsNotNull (attr.FormatErrorMessage ("SomeField"), "#A1-1");
361 Assert.AreEqual ("The field SomeField is invalid.", attr.FormatErrorMessage ("SomeField"), "#A1-2");
363 attr.ErrorMessage = "Test: {0}";
364 Assert.IsNotNull (attr.FormatErrorMessage ("SomeField"), "#A2-1");
365 Assert.AreEqual ("Test: SomeField", attr.FormatErrorMessage ("SomeField"), "#A2-2");
367 attr = new ValidateFooAttribute ();
369 attr.ErrorMessage = null;
371 attr.ErrorMessageResourceName = "ErrorProperty1";
372 attr.ErrorMessageResourceType = typeof (FooErrorMessageProvider);
373 Assert.IsNotNull (attr.FormatErrorMessage ("SomeField"), "#B1-1");
374 Assert.AreEqual ("Error Message 1", attr.FormatErrorMessage ("SomeField"), "#B1-2");
376 attr = new ValidateFooAttribute ();
378 attr.ErrorMessageResourceName = "ErrorProperty6";
379 attr.ErrorMessageResourceType = typeof (FooErrorMessageProvider);
380 Assert.IsNotNull (attr.FormatErrorMessage ("SomeField"), "#B2-1");
381 Assert.AreEqual ("Error Message 6: SomeField", attr.FormatErrorMessage ("SomeField"), "#B2-2");
383 attr = new ValidateFooAttribute ();
385 attr.ErrorMessageResourceName = "ErrorProperty6";
386 attr.ErrorMessageResourceType = typeof (FooErrorMessageProvider);
387 Assert.IsNotNull (attr.FormatErrorMessage ("SomeField"), "#B3-1");
388 Assert.AreEqual ("Error Message 6: ", attr.FormatErrorMessage (null), "#B3-2");
392 public void GetValidationResult ()
394 var attr = new ValidateBarAttribute ();
397 attr.GetValidationResult ("stuff", null);
399 } catch (ArgumentNullException) {
403 var vc = new ValidationContext ("stuff", null, null);
404 vc.DisplayName = "MyStuff";
405 var vr = attr.GetValidationResult ("stuff", vc);
406 Assert.IsNull (vr, "#A2");
408 vr = attr.GetValidationResult (null, vc);
409 Assert.IsNotNull(vr, "#A3-1");
410 Assert.IsNotNull (vr.ErrorMessage, "#A3-2");
411 Assert.AreEqual ("The field MyStuff is invalid.", vr.ErrorMessage, "#A3-3");
413 attr.ErrorMessage = "My Error Message: {0}";
414 vr = attr.GetValidationResult (null, vc);
415 Assert.IsNotNull (vr, "#A4-1");
416 Assert.IsNotNull (vr.ErrorMessage, "#A4-2");
417 Assert.AreEqual ("My Error Message: MyStuff", vr.ErrorMessage, "#A4-3");
419 attr.ErrorMessage = null;
420 attr.ErrorMessageResourceName = "ErrorProperty1";
421 attr.ErrorMessageResourceType = typeof (FooErrorMessageProvider);
422 vr = attr.GetValidationResult (null, vc);
423 Assert.IsNotNull (vr, "#A5-1");
424 Assert.IsNotNull (vr.ErrorMessage, "#A5-2");
425 Assert.AreEqual ("Error Message 1", vr.ErrorMessage, "#A5-3");
427 attr.ErrorMessage = "My Error Message: {0}";
428 attr.ErrorMessageResourceName = null;
429 attr.ErrorMessageResourceType = null;
430 vr = attr.GetValidationResult (null, vc);
431 Assert.IsNotNull (vr, "#A6-1");
432 Assert.IsNotNull (vr.MemberNames, "#A6-2");
434 foreach (string s in vr.MemberNames)
436 Assert.AreEqual (0, count, "#A6-3");
437 Assert.AreEqual ("My Error Message: MyStuff", vr.ErrorMessage, "#A6-4");
439 attr.ValidationResultErrorMessage = "My VR message";
440 vr = attr.GetValidationResult (null, vc);
441 Assert.IsNotNull (vr, "#A7-1");
442 Assert.AreEqual ("My VR message", vr.ErrorMessage, "#A7-2");
446 public void IsValid_Object ()
448 var attr = new ValidateFooAttribute ();
450 AssertExtensions.Throws <NotImplementedException> (() => {
451 // It calls IsValid (object, validationContext) which throws the NIEX, but when that overload is called directly, there's
454 // at System.ComponentModel.DataAnnotations.ValidationAttribute.IsValid(Object value, ValidationContext validationContext)
455 // at System.ComponentModel.DataAnnotations.ValidationAttribute.IsValid(Object value)
456 // at MonoTests.System.ComponentModel.DataAnnotations.ValidationAttributeTest.IsValid_Object() in C:\Users\grendel\Documents\Visual Studio 2010\Projects\System.Web.Test\System.Web.Test\System.ComponentModel.DataAnnotations\ValidationAttributeTest.cs:line 450
460 AssertExtensions.Throws <NotImplementedException> (() => {
461 attr.IsValid ("stuff");
466 public void IsValid_Object_ValidationContext ()
468 var attr = new ValidateBarAttribute ();
470 AssertExtensions.Throws <NullReferenceException> (() => {
471 attr.CallIsValid (null, null);
474 var vc = new ValidationContext ("stuff", null, null);
475 var vr = attr.CallIsValid (null, vc);
476 Assert.IsNotNull (vr, "#A2-1");
477 Assert.IsNotNull (vr.ErrorMessage, "#A2-2");
478 Assert.AreEqual ("The field String is invalid.", vr.ErrorMessage, "#A2-3");
479 Assert.IsNotNull (vr.MemberNames, "#A2-4");
482 foreach (string s in vr.MemberNames)
484 Assert.AreEqual (0, count, "#A2-5");
486 vc.MemberName = "SomeMember";
487 vr = attr.CallIsValid (null, vc);
488 Assert.IsNotNull (vr, "#A3-1");
489 Assert.IsNotNull (vr.ErrorMessage, "#A3-2");
490 Assert.AreEqual ("The field String is invalid.", vr.ErrorMessage, "#A3-3");
491 Assert.IsNotNull (vr.MemberNames, "#A3-4");
493 var list = new List <string> ();
494 foreach (string s in vr.MemberNames)
496 Assert.AreEqual (1, list.Count, "#A3-5");
497 Assert.AreEqual ("SomeMember", list [0], "#A3-6");
501 public void IsValid_Object_ValidationContext_CrossCallsWithNIEX ()
503 var attr = new ValidateSomethingAttribute ();
505 AssertExtensions.Throws<NotImplementedException> (() => {
506 // Thrown from the IsValid (object, ValidationContext) overload!
508 // MonoTests.System.ComponentModel.DataAnnotations.ValidationAttributeTest.IsValid_Object_ValidationContext_02:
509 // System.NotImplementedException : IsValid(object value) has not been implemented by this class. The preferred entry point is GetValidationResult() and classes should override IsValid(object value, ValidationContext context).
511 // at System.ComponentModel.DataAnnotations.ValidationAttribute.IsValid(Object value, ValidationContext validationContext)
512 // at MonoTests.System.ComponentModel.DataAnnotations.ValidateSomethingAttribute.IsValid(Object value) in C:\Users\grendel\Documents\Visual Studio 2010\Projects\System.Web.Test\System.Web.Test\System.ComponentModel.DataAnnotations\ValidationAttributeTest.cs:line 639
513 // at System.ComponentModel.DataAnnotations.ValidationAttribute.IsValid(Object value, ValidationContext validationContext)
514 // at MonoTests.System.ComponentModel.DataAnnotations.ValidateSomethingAttribute.IsValid(Object value) in C:\Users\grendel\Documents\Visual Studio 2010\Projects\System.Web.Test\System.Web.Test\System.ComponentModel.DataAnnotations\ValidationAttributeTest.cs:line 639
515 // at MonoTests.System.ComponentModel.DataAnnotations.ValidationAttributeTest.IsValid_Object_ValidationContext_02() in C:\Users\grendel\Documents\Visual Studio 2010\Projects\System.Web.Test\System.Web.Test\System.ComponentModel.DataAnnotations\ValidationAttributeTest.cs:line 514
516 attr.IsValid ("stuff");
519 AssertExtensions.Throws<NotImplementedException> (() => {
520 // And this one is thrown from the IsValid (object) overload!
522 // MonoTests.System.ComponentModel.DataAnnotations.ValidationAttributeTest.IsValid_Object_ValidationContext_CrossCallsWithNIEX:
523 // System.NotImplementedException : IsValid(object value) has not been implemented by this class. The preferred entry point is GetValidationResult() and classes should override IsValid(object value, ValidationContext context).
525 // at System.ComponentModel.DataAnnotations.ValidationAttribute.IsValid(Object value)
526 // at MonoTests.System.ComponentModel.DataAnnotations.ValidateSomethingAttribute.IsValid(Object value, ValidationContext validationContext) in C:\Users\grendel\Documents\Visual Studio 2010\Projects\System.Web.Test\System.Web.Test\System.ComponentModel.DataAnnotations\ValidationAttributeTest.cs:line 660
527 // at System.ComponentModel.DataAnnotations.ValidationAttribute.IsValid(Object value)
528 // at MonoTests.System.ComponentModel.DataAnnotations.ValidateSomethingAttribute.IsValid(Object value, ValidationContext validationContext) in C:\Users\grendel\Documents\Visual Studio 2010\Projects\System.Web.Test\System.Web.Test\System.ComponentModel.DataAnnotations\ValidationAttributeTest.cs:line 660
529 // at MonoTests.System.ComponentModel.DataAnnotations.ValidateSomethingAttribute.CallIsValid(Object value, ValidationContext validationContext) in C:\Users\grendel\Documents\Visual Studio 2010\Projects\System.Web.Test\System.Web.Test\System.ComponentModel.DataAnnotations\ValidationAttributeTest.cs:line 667
530 // at MonoTests.System.ComponentModel.DataAnnotations.ValidationAttributeTest.IsValid_Object_ValidationContext_CrossCallsWithNIEX() in C:\Users\grendel\Documents\Visual Studio 2010\Projects\System.Web.Test\System.Web.Test\System.ComponentModel.DataAnnotations\ValidationAttributeTest.cs:line 530
532 attr.CallIsValid ("stuff", null);
536 public void Validate_Object_ValidationContext ()
538 var attr = new ValidateBazAttribute ();
541 attr.Validate ("stuff", (ValidationContext) null);
543 } catch (ArgumentNullException) {
547 var vc = new ValidationContext ("stuff", null, null);
549 attr.Validate (null, vc);
550 Assert.Fail ("#A2-1");
551 } catch (ValidationException) {
554 Assert.AreEqual (3, attr.Calls.Count, "#A2-1");
555 Assert.AreEqual ("ValidationResult IsValid (object value, ValidationContext validationContext)", attr.Calls [0], "#A2-2");
556 Assert.AreEqual ("bool IsValid (object value)", attr.Calls [1], "#A2-3");
557 Assert.AreEqual ("string FormatErrorMessage (string name)", attr.Calls [2], "#A2-4");
561 public void Validate_Object_String ()
563 var attr = new ValidateBazAttribute ();
566 attr.Validate (null, (string) null);
568 } catch (ValidationException) {
572 Assert.AreEqual (2, attr.Calls.Count, "#A2-1");
573 Assert.AreEqual ("bool IsValid (object value)", attr.Calls [0], "#A2-2");
574 Assert.AreEqual ("string FormatErrorMessage (string name)", attr.Calls [1], "#A2-3");
578 class ValidateFooAttribute : ValidationAttribute
580 public ValidateFooAttribute ()
584 public ValidateFooAttribute (Func<string> errorMessageAccessor)
585 : base (errorMessageAccessor)
588 public ValidateFooAttribute (string errorMessage)
589 : base (errorMessage)
592 public string GetErrorMessageString ()
594 return ErrorMessageString;
597 public override bool IsValid (object value)
599 return value != null;
604 class ValidateBarAttribute : ValidateFooAttribute
606 public string ValidationResultErrorMessage
612 public override bool IsValid (object value)
614 return value != null;
617 protected override ValidationResult IsValid (object value, ValidationContext validationContext)
619 if (!IsValid (value))
620 return new ValidationResult (ValidationResultErrorMessage);
624 public ValidationResult CallIsValid (object value, ValidationContext validationContext)
626 return base.IsValid (value, validationContext);
631 class ValidateBazAttribute : ValidateBarAttribute
633 public readonly List<string> Calls = new List<string> ();
635 public override bool IsValid (object value)
637 Calls.Add ("bool IsValid (object value)");
638 return base.IsValid (value);
641 protected override ValidationResult IsValid (object value, ValidationContext validationContext)
643 Calls.Add ("ValidationResult IsValid (object value, ValidationContext validationContext)");
644 return base.IsValid (value, validationContext);
647 public override string FormatErrorMessage (string name)
649 Calls.Add ("string FormatErrorMessage (string name)");
650 return base.FormatErrorMessage (name);
654 class ValidateSomethingAttribute : ValidationAttribute
656 public override bool IsValid (object value)
658 return base.IsValid (value, null) == ValidationResult.Success;
661 protected override ValidationResult IsValid (object value, ValidationContext validationContext)
663 if (base.IsValid (value))
664 return ValidationResult.Success;
665 return new ValidationResult ("failed to validate in base class");
668 public ValidationResult CallIsValid (object value, ValidationContext validationContext)
670 return IsValid (value, validationContext);
674 class FooErrorMessageProvider
676 public static string ErrorProperty1
678 get { return "Error Message 1"; }
681 public static int ErrorProperty2
686 public string ErrorProperty3
688 get { return "Error Message 2"; }
691 protected static string ErrorProperty4
693 get { return "Error Message 3"; }
696 public static string ErrorProperty5
701 public static string ErrorProperty6
703 get { return "Error Message 6: {0}"; }
706 public string ErrorField1 = "Error Message 4";
707 public static string ErrorField2 = "Error Message 5";