Example #1
0
        public async Task CaptureMessageAsync_InvokesSend_AndJsonPacketFactoryOnCreate()
        {
            var project           = Guid.NewGuid().ToString();
            var jsonPacketFactory = new TestableJsonPacketFactory(project);
            var client            = new TestableRavenClient(dsnUri, jsonPacketFactory);
            var result            = await client.CaptureMessageAsync("Test");

            Assert.That(result, Is.EqualTo(project));
        }
        public async Task CaptureMessageAsync_ClientReleaseIsIgnored()
        {
            var jsonPacketFactory = new TestableJsonPacketFactory(release : "keep-me");
            var client = new TestableRavenClient(dsnUri, jsonPacketFactory) { Release = "foobar" };
            await client.CaptureMessageAsync("Test");

            var lastEvent = client.LastPacket;

            Assert.That(lastEvent.Release, Is.EqualTo("keep-me"));
        }
        public async Task CaptureMessageAsync_InvokesSend_AndJsonPacketFactoryOnCreate()
        {
            const string dsnUri =
                "http://*****:*****@app.getsentry.com/3739";
            var project           = Guid.NewGuid().ToString();
            var jsonPacketFactory = new TestableJsonPacketFactory(project);
            var client            = new TestableRavenClient(dsnUri, jsonPacketFactory);
            var result            = await client.CaptureMessageAsync("Test");

            Assert.That(result, Is.EqualTo(project));
        }
Example #4
0
        public async Task CaptureMessageAsync_SendsRelease()
        {
            var client = new TestableRavenClient(dsnUri)
            {
                Release = "foobar"
            };
            await client.CaptureMessageAsync("Test");

            var lastEvent = client.LastPacket;

            Assert.That(lastEvent.Release, Is.EqualTo("foobar"));
        }
Example #5
0
        public async Task CaptureMessageAsync_ClientReleaseIsIgnored()
        {
            var jsonPacketFactory = new TestableJsonPacketFactory(release: "keep-me");
            var client            = new TestableRavenClient(dsnUri, jsonPacketFactory)
            {
                Release = "foobar"
            };
            await client.CaptureMessageAsync("Test");

            var lastEvent = client.LastPacket;

            Assert.That(lastEvent.Release, Is.EqualTo("keep-me"));
        }
Example #6
0
        public async Task CaptureMessageAsync_OnlyMessageTags()
        {
            var messageTags = new Dictionary <string, string> {
                { "key", "value" }, { "foo", "bar" }
            };

            var client = new TestableRavenClient(dsnUri);
            await client.CaptureMessageAsync("Test", ErrorLevel.Info, messageTags);

            var lastEvent = client.LastPacket;

            Assert.That(lastEvent.Tags["key"], Is.EqualTo("value"));
            Assert.That(lastEvent.Tags["foo"], Is.EqualTo("bar"));
        }
Example #7
0
        public async Task CaptureMessageAsync_OnlyDefaultTags()
        {
            var client = new TestableRavenClient(dsnUri);

            client.Tags.Add("key", "value");
            client.Tags.Add("foo", "bar");
            // client.Tags = defaultTags;
            await client.CaptureMessageAsync("Test", ErrorLevel.Info);

            var lastEvent = client.LastPacket;

            Assert.That(lastEvent.Tags["key"], Is.EqualTo("value"));
            Assert.That(lastEvent.Tags["foo"], Is.EqualTo("bar"));
        }
        public async Task CaptureMessageAsync_InvokesSend_AndJsonPacketFactoryOnCreate()
        {
            var project = Guid.NewGuid().ToString();
            var jsonPacketFactory = new TestableJsonPacketFactory(project);
            var client = new TestableRavenClient(dsnUri, jsonPacketFactory);
            var result = await client.CaptureMessageAsync("Test");

            Assert.That(result, Is.EqualTo(project));
        }
        public async Task CaptureMessageAsync_TagHandling()
        {
            var messageTags = new Dictionary<string, string> { { "key", "another value" } };

            var client = new TestableRavenClient(dsnUri);
            client.Tags.Add("key", "value");
            client.Tags.Add("foo", "bar");
            await client.CaptureMessageAsync("Test", ErrorLevel.Info, messageTags);

            var lastEvent = client.LastPacket;

            Assert.That(lastEvent.Tags["key"], Is.EqualTo("another value"));
            Assert.That(lastEvent.Tags["foo"], Is.EqualTo("bar"));
        }
        public async Task CaptureMessageAsync_SendsRelease()
        {
            var client = new TestableRavenClient(dsnUri) { Release = "foobar" };
            await client.CaptureMessageAsync("Test");

            var lastEvent = client.LastPacket;

            Assert.That(lastEvent.Release, Is.EqualTo("foobar"));
        }
        public async Task CaptureMessageAsync_OnlyDefaultTags()
        {
            var client = new TestableRavenClient(dsnUri);
            client.Tags.Add("key", "value");
            client.Tags.Add("foo", "bar");
            // client.Tags = defaultTags;
            await client.CaptureMessageAsync("Test", ErrorLevel.Info);

            var lastEvent = client.LastPacket;

            Assert.That(lastEvent.Tags["key"], Is.EqualTo("value"));
            Assert.That(lastEvent.Tags["foo"], Is.EqualTo("bar"));
        }