public void DisableCompression() { this.settings["progstr.api.enablecompression"] = "false"; var client = new TestClient(this.settings); client.ConfigureRequest(null); var headers = this.NormalizeLineEndings(client.Headers); headers.ShouldBe(this.NormalizeLineEndings(@"Accept: application/json Content-Type: application/json; charset=utf-8 User-Agent: progstr-dotnet 1.0 X-Progstr-Token: 7cf122aa-6df5-4fba-a5b3-f6f0a54e7b01 ")); }
public void DefaultToCompression() { //throw new InvalidOperationException(this.settings["progstr.log.apitoken"]); var client = new TestClient(this.settings); client.ConfigureRequest(null); var headers = this.NormalizeLineEndings(client.Headers); headers.ShouldBe(this.NormalizeLineEndings(@"Accept: application/json Content-Type: application/json; charset=utf-8 Content-Encoding: gzip User-Agent: progstr-dotnet 1.0 X-Progstr-Token: 7cf122aa-6df5-4fba-a5b3-f6f0a54e7b01 ")); }
public BodySet() { this.message = new LogMessage { Level = LogLevel.Fatal, Source = "test-source", Host = "web-server1", Text = "Something wild", Time = Time.MillisecondNow }; this.jsonTemplate = "{\"host\":\"web-server1\",\"level\":3,\"source\":\"test-source\",\"text\":\"Something wild\",\"time\":[TIME]}"; this.settings = new NameValueCollection(); this.settings["progstr.log.apitoken"] = "DEMO"; this.client = new TestClient(this.settings); }
public void OverrideApiUrl() { this.settings["progstr.api.baseurl"] = "localhost:9091"; var client = new TestClient(this.settings); client.ApiUrl.ShouldBe("http://localhost:9091/v1/log"); }
public void IgnoreLeadingProtocolForApiUrl() { this.settings["progstr.api.baseurl"] = "http://localhost:9091"; var client = new TestClient(this.settings); client.ApiUrl.ShouldBe("http://localhost:9091/v1/log"); }
public void DisableCompression() { this.settings["progstr.api.enablecompression"] = "false"; var client = new TestClient(this.settings); client.EnableCompression.ShouldBe(false); }
public void CompressionDefaultEnabled() { var client = new TestClient(this.settings); client.EnableCompression.ShouldBe(true); }
public void ApiBaseUrl() { var client = new TestClient(this.settings); client.ApiUrl.ShouldBe("http://api.progstr.com/v1/log"); }