示例#1
0
        public void Fluent_Several()
        {
            TestLogClient client = new TestLogClient();
            var           ev     = Events.Create().UseLogClient(client)
                                   .Text("test")
                                   .AddText("test")
                                   .Link("test")
                                   .Source("test")
                                   .Tags("test")
                                   .AddTags("test test")
                                   .Value(123)
                                   .Data("test")
                                   .AddData("test")
                                   .Geo(-123.456, -123.456)
                                   .Geo("-123.456", "-123.456")
                                   .Post()
                                   .Event;

            client.AssertPostWasValid();
            Assert.IsTrue(client.HttpClient.Data["text"] == ev.Text);
            Assert.IsTrue(client.HttpClient.Data["link"] == ev.Link);
            Assert.IsTrue(client.HttpClient.Data["source"] == ev.Source);
            Assert.IsTrue(client.HttpClient.Data["tags"] == string.Join(" ", ev.Tags.ToArray()));
            Assert.IsTrue(client.HttpClient.Data["value"] == ev.Value.ToString());
            Assert.IsTrue(client.HttpClient.Data["data"] == ev.Data);
            Assert.IsTrue(client.HttpClient.Data["geo"] == ev.Geo);
            Assert.IsNotNull(ev);
        }
示例#2
0
 public void LogClient_Post()
 {
     TestLogClient client = new TestLogClient();
     Event ev = new Event();
     ev.Text = "foo";
     client.Post(ev);
     client.AssertPostWasValid();
     Assert.IsTrue(client.HttpClient.Data["text"] == ev.Text);
 }
示例#3
0
        public void Fluent_Post()
        {
            TestLogClient client = new TestLogClient();
            var           e      = Events.Create().UseLogClient(client).Text("foo").Post();

            client.AssertPostWasValid();
            Assert.IsTrue(client.HttpClient.Data["text"] == e.Event.Text);
            Assert.IsNotNull(e);
        }
示例#4
0
        public void LogClient_Post()
        {
            TestLogClient client = new TestLogClient();
            Event         ev     = new Event();

            ev.Text = "foo";
            client.Post(ev);
            client.AssertPostWasValid();
            Assert.IsTrue(client.HttpClient.Data["text"] == ev.Text);
        }
示例#5
0
 public void Fluent_Several()
 {
     TestLogClient client = new TestLogClient();
     var ev = Events.Create().UseLogClient(client)
             .Text("test")
             .AddText("test")
             .Link("test")
             .Source("test")
             .Tags("test")
             .AddTags("test test")
             .Value(123)
             .Data("test")
             .AddData("test")
             .Geo(-123.456, -123.456)
             .Geo("-123.456", "-123.456")
             .Post()
             .Event;
     client.AssertPostWasValid();
     Assert.IsTrue(client.HttpClient.Data["text"] == ev.Text);
     Assert.IsTrue(client.HttpClient.Data["link"] == ev.Link);
     Assert.IsTrue(client.HttpClient.Data["source"] == ev.Source);
     Assert.IsTrue(client.HttpClient.Data["tags"] == string.Join(" ", ev.Tags.ToArray()));
     Assert.IsTrue(client.HttpClient.Data["value"] == ev.Value.ToString());
     Assert.IsTrue(client.HttpClient.Data["data"] == ev.Data);
     Assert.IsTrue(client.HttpClient.Data["geo"] == ev.Geo);
     Assert.IsNotNull(ev);
 }
示例#6
0
 public void Fluent_Post()
 {
     TestLogClient client = new TestLogClient();
     var e = Events.Create().UseLogClient(client).Text("foo").Post();
     client.AssertPostWasValid();
     Assert.IsTrue(client.HttpClient.Data["text"] == e.Event.Text);
     Assert.IsNotNull(e);
 }