private static void UserVerification() { Console.WriteLine("Enter your username:"******"This user is approved"); } else { Console.WriteLine("Wrong user. Try again!"); UserVerification(); } }
protected void OnCompareTargetChanged() { if (this.CompareTarget != CompareTarget.Id) { return; } if (IdentityChecker == null) { throw new NotSupportedException("No IdentityChecker assigned, cannot perform Id check"); } if (!IdentityChecker.SupportsId(this.Info.PropertyType)) { throw new NotSupportedException(string.Format("Property {0}: type ({1}) must support Id check", this.Info.Name, this.Info.PropertyType)); } }
protected static void CheckId(object expected, object candidate, string objectName) { // If both null we are ok, and can't check the Id property so quit now. if (CheckNullNotNull(expected, candidate, objectName)) { return; } if (IdentityChecker == null) { throw new NotSupportedException("No IdentityChecker assigned, cannot perform Id check"); } var expectedId = IdentityChecker.ExtractId(expected); var candidateId = IdentityChecker.ExtractId(candidate); if (!Equals(expectedId, candidateId)) { throw new PropertyCheckException(objectName, expectedId, candidateId); } }
public void IdentityChecker_Returns_False_If_Invalid_Name_Is_Entered() { Assert.False(IdentityChecker.TestIfStarWarsActor(PeopleFetcher.GetListOfPeople(), "Dork Waiter")); }
public void IdentityChecker_Returns_True_If_Valid_Name_Is_Entered() { Assert.True(IdentityChecker.TestIfStarWarsActor(PeopleFetcher.GetListOfPeople(), "Darth Vader")); }