public async Task Create_a_formatted_conf_file()
        {
            // arrange
            JObject raw             = JObject.Parse(await File.ReadAllTextAsync($"data{Path.DirectorySeparatorChar}ServiceTags_Public_20200629.json"));
            var     nginxConfString = new NginxConfString(raw.ToObject <Runners>());

            // act
            var content = await nginxConfString.Create();

            // assert
            Assert.NotEqual(0, content.Length);
        }
Esempio n. 2
0
        //https://www.microsoft.com/en-us/download/confirmation.aspx?id=56519

        static async Task Main(string[] args)
        {
            AzureIPv4Ranges iPv4Ranges = new AzureIPv4Ranges(new HttpClient(), new GenerateFilename(DateTime.Now));
            var             ranges     = await iPv4Ranges.GetJsonFile();

            if (ranges.IsSuccess)
            {
                AzureIPv4Parser parser     = new AzureIPv4Parser(ranges.Value);
                NginxConfString confString = new NginxConfString(await parser.Parse());

                var directoryInfo = Directory.CreateDirectory(Output);
                using (var output = new StreamWriter(OutputGithubActionsRunnersConf, false, Encoding.UTF8))
                {
                    await output.WriteAsync(await confString.Create());

                    await output.FlushAsync();
                }
            }
        }