public void ComandDispatch_ShouldOverwriteProperties()
        {
            var command = new OverwriteCommand();
            var args    = new[] { "/A", "1", "/B", "2" };

            CommandDispatcher.AssertWorksCorrectly(command, args);
            command.Result.Should().Be("1,2");
        }
Exemplo n.º 2
0
        public void DoNotLooseOtherArgumentsWhenPropertyOptionsAreOverwritten()
        {
            var command       = new OverwriteCommand();
            var consoleOutput = new StringBuilder();

            var outputCode = ConsoleCommandDispatcher.DispatchCommand(
                command,
                new[] { "/A", "1", "/B", "2" },
                new StringWriter(consoleOutput));

            Assert.That(String.IsNullOrEmpty(consoleOutput.ToString()), "Console output is not empty");
            Assert.AreEqual(0, outputCode, "Output is not zero");
            StringAssert.AreEqualIgnoringCase("1,2", command.Result);
        }
        public override void Specify()
        {
            it("does not lose other arguments when property Options is overwritten", () =>
            {
                var command = new OverwriteCommand();
                var consoleOutput = new StringBuilder();

                var outputCode = ConsoleCommandDispatcher.DispatchCommand(
                    command, 
                    new []{"/A", "1", "/B", "2"}, 
                    new StringWriter(consoleOutput));

                expect(() => String.IsNullOrEmpty(consoleOutput.ToString()));
                expect(() => outputCode == 0);
                expect(() => command.Result == "1,2");
            });
        }
Exemplo n.º 4
0
        public override void Specify()
        {
            it("does not lose other arguments when property Options is overwritten", () =>
            {
                var command       = new OverwriteCommand();
                var consoleOutput = new StringBuilder();

                var outputCode = ConsoleCommandDispatcher.DispatchCommand(
                    command,
                    new [] { "/A", "1", "/B", "2" },
                    new StringWriter(consoleOutput));

                expect(() => String.IsNullOrEmpty(consoleOutput.ToString()));
                expect(() => outputCode == 0);
                expect(() => command.Result == "1,2");
            });
        }