public SpaceTests(ITestOutputHelper testOutputHelper) { LogSettings.RegisterDefaultLogger <XUnitLogger>(LogLevels.Verbose, testOutputHelper); _confluenceClient = ConfluenceClient.Create(TestConfluenceUri); var username = Environment.GetEnvironmentVariable("confluence_test_username"); var password = Environment.GetEnvironmentVariable("confluence_test_password"); if (!string.IsNullOrEmpty(username) && !string.IsNullOrEmpty(password)) { _confluenceClient.SetBasicAuthentication(username, password); } }
protected ConfluenceIntegrationTests(ITestOutputHelper testOutputHelper) { LogSettings.ExceptionToStacktrace = exception => exception.ToStringDemystified(); LogSettings.RegisterDefaultLogger <XUnitLogger>(LogLevels.Verbose, testOutputHelper); ConfluenceTestClient = ConfluenceClient.Create(TestConfluenceUri); var username = Environment.GetEnvironmentVariable("confluence_test_username"); var password = Environment.GetEnvironmentVariable("confluence_test_password"); if (!string.IsNullOrEmpty(username) && !string.IsNullOrEmpty(password)) { ConfluenceTestClient.SetBasicAuthentication(username, password); } }
public void TestSerializeVersion() { var jsonNetJsonSerializer = ConfluenceClient.CreateJsonNetJsonSerializer(); var version = new Entities.Version { // NOTE: No fractional seconds (milliseconds) in date When = new DateTimeOffset(2020, 1, 1, 0, 0, 0, TimeSpan.Zero) }; var json = jsonNetJsonSerializer.Serialize(version); Assert.NotEmpty(json); Assert.Equal(39, json.Length); version = new Entities.Version { // NOTE: Fractional seconds (milliseconds) in date When = new DateTimeOffset(2020, 1, 1, 0, 0, 0, 10, TimeSpan.Zero) }; json = jsonNetJsonSerializer.Serialize(version); Assert.NotEmpty(json); Assert.Equal(39, json.Length); }