async Task TestRead(CancellationToken cancellationToken)
        {
            var model = await client.Read(cancellationToken).ConfigureAwait(false);

            Assert.AreEqual(RuntimeInformation.IsOSPlatform(OSPlatform.Windows), model.WindowsHost);

            //uhh not much else to do
        }
Exemplo n.º 2
0
        async Task TestRead(CancellationToken cancellationToken)
        {
            Administration model;

            try
            {
                model = await client.Read(cancellationToken).ConfigureAwait(false);
            }
            catch (RateLimitException)
            {
                Assert.Inconclusive("GitHub rate limit hit while testing administration endpoint. Set environment variable TGS4_TEST_GITHUB_TOKEN to fix this!");
                return;                 //c# needs the equivalent of [noreturn]
            }
            Assert.AreEqual(RuntimeInformation.IsOSPlatform(OSPlatform.Windows), model.WindowsHost);

            //we've released a few 4.x versions now, check the release checker is at least somewhat functional
            Assert.AreEqual(4, model.LatestVersion.Major);
        }
        async Task TestRead(CancellationToken cancellationToken)
        {
            AdministrationResponse model;

            try
            {
                model = await client.Read(cancellationToken).ConfigureAwait(false);
            }
            catch (RateLimitException)
            {
                if (String.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable("TGS4_TEST_GITHUB_TOKEN")))
                {
                    Assert.Inconclusive("GitHub rate limit hit while testing administration endpoint. Set environment variable TGS4_TEST_GITHUB_TOKEN to fix this!");
                }

                // CI fails all the time b/c of this, ignore it
                return;
            }

            //we've released a few 4.x versions now, check the release checker is at least somewhat functional
            Assert.AreEqual(4, model.LatestVersion.Major);
        }