예제 #1
0
 public void ParameterMandatory_ValidationNoTestNullIntFailTest()
 {
   string[] args = new string[] { "TestStr=\"Test Name\"" };
   ParameterMandatory parameterMandatory = new ParameterMandatory("ParameterMandatoryTest", Assembly.GetExecutingAssembly());
   parameterMandatory.Parse(args);
   var validationResult = parameterMandatory.Validate();
   Assert.IsFalse(validationResult, "The validation result of 'ParameterMandatory' with a missing 'TestNullInt' argument should fail.");
 }
예제 #2
0
 public void ParameterMandatory_ValidationPassTest()
 {
   string[] args = new string[] { "TestStr=\"Test Name\"", "TestNullInt=42" };
   ParameterMandatory parameterMandatory = new ParameterMandatory("ParameterMandatoryTest", Assembly.GetExecutingAssembly());
   parameterMandatory.Parse(args);
   var validationResult = parameterMandatory.Validate();
   Assert.IsTrue(validationResult, "The validation result of 'ParameterMandatory' with a valid 'TestStr' property should be true.");
   Assert.AreEqual("Test Name", parameterMandatory.TestStr, "The parameter property value should match with the parsed value.");
 }
예제 #3
0
 public void ParameterMandatory_ValidationFailTest()
 {
   ParameterMandatory parameterMandatory = new ParameterMandatory("ParameterMandatoryTest", Assembly.GetExecutingAssembly());
   var validationResult = parameterMandatory.Validate();
   Assert.IsFalse(validationResult, "The validation result of 'ParameterMandatory' with no arguments should fail.");
 }
예제 #4
0
 public void ParameterMandatory_ConstructorTest()
 {
   ParameterMandatory parameterMandatory = new ParameterMandatory("ParameterMandatoryTest", Assembly.GetExecutingAssembly());
   Assert.IsNotNull(parameterMandatory, "The 'ParameterMandatory' constructor should return a valid instance.");
 }