示例#1
0
        public void GivenManifestFileOnSameDirectoryItThrowsWhenTheManifestFileCannotBeFound()
        {
            var    toolManifest = new ToolManifestFinder(new DirectoryPath(_testDirectoryRoot), _fileSystem);
            Action a            = () => toolManifest.FindFirst();

            a.ShouldThrow <ToolManifestCannotBeFoundException>().And.Message.Should()
            .Contain(string.Format(LocalizableStrings.CannotFindAnyManifestsFileSearched, ""));
        }
示例#2
0
        public void GivenManifestFileOnSameDirectoryItDoesNotThrowsWhenTheManifestFileIsNotValid()
        {
            string manifestPath = Path.Combine(_testDirectoryRoot, _manifestFilename);

            _fileSystem.File.WriteAllText(manifestPath, _jsonWithMissingField);
            var      toolManifest         = new ToolManifestFinder(new DirectoryPath(_testDirectoryRoot), _fileSystem);
            FilePath toolmanifestFilePath = toolManifest.FindFirst();

            toolmanifestFilePath.Value.Should().Be(manifestPath);
        }
示例#3
0
        public void GivenManifestFileOnSameDirectoryItCanFindTheFirstManifestFile()
        {
            string manifestPath = Path.Combine(_testDirectoryRoot, _manifestFilename);

            _fileSystem.File.WriteAllText(manifestPath, _jsonContent);
            var      toolManifest         = new ToolManifestFinder(new DirectoryPath(_testDirectoryRoot), _fileSystem);
            FilePath toolmanifestFilePath = toolManifest.FindFirst();

            toolmanifestFilePath.Value.Should().Be(manifestPath);
        }