public void CheckIdentifier_ArgumentValidate_ShouldShowYesMessage()
 {
     using (var writer = new StringWriter())
     {
         Console.SetOut(writer);
         string[] args = { "sadg" };
         CheckIdentifier.Main(args);
         Assert.Equal(CheckIdentifier.VALID_SUCCESS + "\r\n", writer.ToString());
     }
 }
 public void CheckIdentifier_ArgumentIsNotValidateFromNotSymbolInTheEnd_ShouldShowNoMessage()
 {
     using (var writer = new StringWriter())
     {
         Console.SetOut(writer);
         string[] args = { "sadg$" };
         CheckIdentifier.Main(args);
         Assert.Equal(CheckIdentifier.VALID_FAIL + "$' in the position 4.\r\n", writer.ToString());
     }
 }
 public void CheckIdentifier_SomeArguments_ShouldShowErrorMessage()
 {
     using (var writer = new StringWriter())
     {
         Console.SetOut(writer);
         string[] args = { "dsf", "dsfg" };
         CheckIdentifier.Main(args);
         Assert.Equal(CheckIdentifier.ERROR_MSG + "\r\n", writer.ToString());
     }
 }
 public void CheckIdentifier_ArgumentValidateWithSomeDigitAndCapitalLetters_ShouldShowYesMessage()
 {
     using (var writer = new StringWriter())
     {
         Console.SetOut(writer);
         string[] args = { "s113GE4228adDg14G64T" };
         CheckIdentifier.Main(args);
         Assert.Equal(CheckIdentifier.VALID_SUCCESS + "\r\n", writer.ToString());
     }
 }
Example #5
0
 public void ArgumentVerification_NotShouldVerificatiotStringWithSpaceInStart()
 {
     Assert.Equal(0, CheckIdentifier.ArgumentVerification(" gr eat"));
 }
Example #6
0
 public void ArgumentVerification_NotShouldVerificatiotStringOnlyWithNumberInStart()
 {
     Assert.Equal(0, CheckIdentifier.ArgumentVerification("4"));
 }
Example #7
0
 public void ArgumentVerification_ShouldVerificatiotStringWithSomeNumberInEnd()
 {
     Assert.Equal(-1, CheckIdentifier.ArgumentVerification("great44"));
 }
Example #8
0
 public void ArgumentVerification_ShouldVerificationString()
 {
     Assert.Equal(-1, CheckIdentifier.ArgumentVerification("great"));
 }