Beispiel #1
0
    public void TestParser_parses_InfoLine()
    {
        var parser = new TestOutputParser();

        var          actual   = parser.Parse(Outputs.Test);
        const string expected = "7-Zip 19.00 (x64) : Copyright (c) 1999-2018 Igor Pavlov : 2019-02-21";

        actual.Information.ShouldBe(expected);
    }
Beispiel #2
0
    public void TestParser_parses_Archives_isOk()
    {
        var    parser   = new TestOutputParser();
        string expected = @"Path = .\nested.zip
Type = zip
Physical Size = 2198368
Everything is Ok
".UnifyLineEndings();

        var actual = parser.Parse(Outputs.Test).Archives.Single(x => x.IsOk);

        actual.FileName.ShouldBe(".\\nested.zip");
        actual.Output.UnifyLineEndings().ShouldBe(expected);
    }
Beispiel #3
0
    public void TestParser_parses_Archives_isNotOk()
    {
        var    parser   = new TestOutputParser();
        string expected = @"ERROR: foo.zip
foo.zip
Open ERROR: Can not open the file as [zip] archive
ERRORS:
Is not archive
".UnifyLineEndings();

        var actual = parser.Parse(Outputs.Test).Archives.Single(x => !x.IsOk);

        actual.FileName.ShouldBe("foo.zip");
        actual.Output.UnifyLineEndings().ShouldBe(expected);
    }
Beispiel #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TestCommand"/> class.
 /// </summary>
 public TestCommand()
 {
     outputParser = new TestOutputParser();
 }