Пример #1
0
        public void When_passing_zero_arguments_to_quit_will_succeed()
        {
            var stream = new MemoryStream();
            var quit   = new QuitCommand(null);

            quit.SetContext(stream);
            Assert.IsTrue(quit.Init());
        }
Пример #2
0
        public void When_calling_execute_will_call_action()
        {
            var  stream    = new MemoryStream();
            bool wasCalled = false;
            var  quit      = new QuitCommand(() => wasCalled = true);

            quit.SetContext(stream);
            quit.Execute();
            Assert.IsTrue(wasCalled);
        }
Пример #3
0
        public void When_passing_arguments_to_quit_will_send_error()
        {
            var stream = new MemoryStream();
            var quit   = new QuitCommand(null);

            quit.SetContext(stream);

            quit.Init("foo");
            Assert.AreEqual("CLIENT_ERROR Quit accepts no paramters\r\n", ReadAll(stream));
        }