Пример #1
0
        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);
        }
Пример #2
0
        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);
        }
Пример #3
0
        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);
        }