Exemplo n.º 1
0
        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
            "));
        }
Exemplo n.º 2
0
        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
            "));
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
 public void OverrideApiUrl()
 {
     this.settings["progstr.api.baseurl"] = "localhost:9091";
     var client = new TestClient(this.settings);
     client.ApiUrl.ShouldBe("http://localhost:9091/v1/log");
 }
Exemplo n.º 5
0
 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");
 }
Exemplo n.º 6
0
 public void DisableCompression()
 {
     this.settings["progstr.api.enablecompression"] = "false";
     var client = new TestClient(this.settings);
     client.EnableCompression.ShouldBe(false);
 }
Exemplo n.º 7
0
 public void CompressionDefaultEnabled()
 {
     var client = new TestClient(this.settings);
     client.EnableCompression.ShouldBe(true);
 }
Exemplo n.º 8
0
 public void ApiBaseUrl()
 {
     var client = new TestClient(this.settings);
     client.ApiUrl.ShouldBe("http://api.progstr.com/v1/log");
 }