public void ThrowWhenTooFewParametersPassed(string[] args, string expected) { var verifier = new MockVerifier(); var provider = new CustomFakeLevelsProvider(); var command = new VerifyCommand(provider, verifier); var e = Assert.Throws <InvalidCommandArrayException>(() => command.Execute(args)); Assert.Equal(expected, e.Message); }
public void RunCorrectVerifierForUser(FakeLevelsProvider provider, string levelId, string user) { var mockVerifier = new MockVerifier(); var command = new VerifyCommand(provider, mockVerifier); command.Execute(levelId, user); Assert.Equal(levelId, mockVerifier.Level.Id); Assert.Equal(user, mockVerifier.User); }
public void ReturnResultFromVerifier(VerifierResult toReturn) { var verifier = new MockVerifier() { Return = toReturn }; var provider = new CustomFakeLevelsProvider() { Level = null }; var command = new VerifyCommand(provider, verifier); var result = command.Execute("", ""); Assert.Equal(toReturn, result); }