Пример #1
0
    public void Should_Set_output_null_on_outputCommand_whithout_output()
    {
        var command            = new Mock <BaseOutputCommand <IOutput> >();
        var outputParseCommand = command.As <ICanParseOutput>();
        var fixture            = new SevenZipRunnerFixture
        {
            Settings = new SevenZipSettings
            {
                Command = command.Object
            }
        };

        fixture.GivenProcessReturnsStdOutputOf(null);

        fixture.Run();

        outputParseCommand.Verify(c => c.SetRawOutput(null !), Times.Once);
    }
Пример #2
0
    public void Should_Set_output_on_outputCommand()
    {
        var command            = new Mock <BaseOutputCommand <IOutput> >();
        var outputParseCommand = command.As <ICanParseOutput>();
        var parser             = new Mock <IOutputParser <IOutput> >();

        command.Setup(c => c.OutputParser).Returns(parser.Object);
        var fixture = new SevenZipRunnerFixture
        {
            Settings = new SevenZipSettings
            {
                Command = command.Object
            }
        };
        var expected = new[] { "this", "is", "the", "output" };

        fixture.GivenProcessReturnsStdOutputOf(expected);

        fixture.Run();

        outputParseCommand.Verify(c => c.SetRawOutput(expected), Times.Once);
    }