Inheritance: IEnvironmentRequirement
Exemplo n.º 1
0
        public void negative_test()
        {
            var log = new PackageLog();

            var folder = Guid.NewGuid().ToString();
            var requirement = new FolderExists(folder);

            requirement.Check(log);

            log.Success.ShouldBeFalse();
            log.FullTraceText().ShouldContain("Folder '{0}' does not exist!".ToFormat(folder));
        }
Exemplo n.º 2
0
        public void positive_test()
        {
            new FileSystem().CreateDirectory("foo");

            var log = new PackageLog();

            var requirement = new FolderExists("foo");

            requirement.Check(log);

            log.Success.ShouldBeTrue();
            log.FullTraceText().ShouldContain("Folder 'foo' exists");
        }
Exemplo n.º 3
0
        public void positive_test_with_generic()
        {
            new FileSystem().CreateDirectory("foo");
            var settings = new FileSettings
            {
                Folder = "foo"
            };

            var log = new PackageLog();

            var requirement = new FolderExists<FileSettings>(x => x.Folder, settings);

            requirement.Check(log);

            log.Success.ShouldBeTrue();
            log.FullTraceText().ShouldContain("Folder 'foo' defined by FileSettings.Folder exists");
        }
Exemplo n.º 4
0
        public void negative_test_with_settings()
        {
            var log = new PackageLog();

            var folder = Guid.NewGuid().ToString();
            var settings = new FileSettings
            {
                Folder = folder
            };

            var requirement = new FolderExists<FileSettings>(x => x.Folder, settings);

            requirement.Check(log);

            log.Success.ShouldBeFalse();
            log.FullTraceText().ShouldContain("Folder '{0}' defined by FileSettings.Folder does not exist!".ToFormat(folder));
        }