public void ParameterMaxStringLength_ValidationTest()
 {
   string[] args = new string[] { "TestStr=\"012345\"" };
   ParameterMaxStringLength parameterMaxStringLength = new ParameterMaxStringLength("ParameterMaxStringLengthTest", Assembly.GetExecutingAssembly());
   parameterMaxStringLength.Parse(args);
   var validationResult = parameterMaxStringLength.Validate();
   Assert.IsTrue(validationResult, "The validation result of 'ParameterMaxStringLength' with a valid 'TestStr' property should be true.");
   Assert.AreEqual("012345", parameterMaxStringLength.TestStr, "The parameter property value should match with the parsed value.");
 }
 public void ParameterMaxStringLength_ValidationFailTest()
 {
   string[] args = new string[] { "TestStr=\"0123456789\"" };
   ParameterMaxStringLength parameterMaxStringLength = new ParameterMaxStringLength("ParameterMaxStringLengthTest", Assembly.GetExecutingAssembly());
   parameterMaxStringLength.Parse(args);
   var validationResult = parameterMaxStringLength.Validate();
   Assert.IsFalse(validationResult, "The validation result of 'ParameterMaxStringLength' with an invalid 'TestStr' property should fail.");
   var validationError = parameterMaxStringLength.ValidationErrorList.Where(err => err.PropertyMetaInfo.PropertyInfo.Name == "TestStr").SingleOrDefault();
   StringAssert.Contains(validationError.Message, "The value of",  "The error message should match with the expected value." );
   StringAssert.Contains(validationError.Message, "longer than 6 characters", "The error message should match with the expected value.");
 }
 public void ParameterMaxStringLength_ConstructorTest()
 {
   ParameterMaxStringLength parameterMaxStringLength = new ParameterMaxStringLength("ParameterMaxStringLengthTest", Assembly.GetExecutingAssembly());
   Assert.IsNotNull(parameterMaxStringLength, "The 'ParameterMaxStringLength' constructor should return a valid instance.");
 }