Пример #1
0
    public async void Should_not_prove_directory_existence_if_does_not_exists()
    {
        const string fakePath = "/var/tests";
        var          mock     = ArbitraryIO.Directories(ArbitraryIO.DirectoryPaths(samples: Maybe.Nothing <ushort>()));
        var          sut      = new PathExistence(mock, new Paths().AddDirectory(fakePath).Content);

        var outcome = await sut.VerifyAsync();

        outcome.Should().NotBeNull()
        .And.BeOfType <Bad <Evidence, string> >()
        .Which.FailedWith().Single().Should().Be($"{fakePath} directory is not found.");
    }
Пример #2
0
    public async void Should_prove_directory_existence_if_exists()
    {
        const string fakePath = "/var/tests";
        var          mock     = ArbitraryIO.Directories(ArbitraryIO.DirectoryPaths(
                                                            samples: Maybe.Nothing <ushort>(), fakePath));
        var sut = new PathExistence(mock, new Paths().AddDirectory(fakePath).Content);

        var outcome = await sut.VerifyAsync();

        outcome.Should().NotBeNull()
        .And.BeOfType <Ok <Evidence, string> >()
        .Which.SucceededWith().Should().BeEquivalentTo(new Evidence(typeof(PathExistence),
                                                                    new Paths().AddDirectory(fakePath).Content));
    }