Ejemplo n.º 1
0
        static int Main(string[] args)
        {
            var fileSystem         = new FileSystem();
            var binaryLogProcessor = new BinaryLogProcessor(new BinaryLogReader());
            var buildLogProcessor  = new BuildLogProcessor(fileSystem, binaryLogProcessor);
            var commandLineParser  = new CommandLineParser(System.Console.WriteLine);
            var program            = new Program(commandLineParser, buildLogProcessor);

            return(program.Run(args) ? 0 : 1);
        }
Ejemplo n.º 2
0
        private CreateCheckRun GetCheckRun(
            IBinaryLogProcessor binaryLogProcessor,
            string inputFile              = null,
            string cloneRoot              = null,
            string owner                  = null,
            string repo                   = null,
            string hash                   = null,
            string configurationFile      = null,
            MockFileSystem mockFileSystem = null)
        {
            inputFile = inputFile ?? Faker.System.FilePath();
            cloneRoot = cloneRoot ?? Faker.System.DirectoryPath();

            var outputFile = Faker.System.FilePath();

            mockFileSystem = mockFileSystem ?? new MockFileSystem();
            mockFileSystem.AddFile(inputFile, new MockFileData(string.Empty, Encoding.UTF8));
            mockFileSystem.AddDirectory(Path.GetDirectoryName(outputFile));

            var buildLogProcessor = new BuildLogProcessor(mockFileSystem, binaryLogProcessor,
                                                          TestLogger.Create <BuildLogProcessor>(_testOutputHelper));

            buildLogProcessor.Proces(
                inputFile,
                outputFile,
                cloneRoot,
                owner,
                repo,
                hash,
                configurationFile);

            mockFileSystem.FileExists(outputFile).Should().BeTrue();

            var output = mockFileSystem.GetFile(outputFile).TextContents;

            output.Should().NotBeNullOrWhiteSpace();

            return(JsonConvert.DeserializeObject <CreateCheckRun>(output));
        }