Beispiel #1
0
        public void should_be_able_to_upload_correctly()
        {
            var listener = new ListenerStub();
            var dto      = CreateExceptionDTO();
            var e1       = new ErrorReportDTO("dsjklsdfl", dto,
                                              new[] { new ContextCollectionDTO("name1"), new ContextCollectionDTO("name2") });

            var url = new Uri($"http://localhost:{listener.ListenerPort}/");
            var sut = new UploadToCoderr(url, "cramply", "majs");

            sut.UploadReport(e1);

            listener.Wait(5000).Should().BeTrue();
        }
Beispiel #2
0
        //[Fact] //TODO: Readd
        public void should_report_invalid_app_key()
        {
            var listener = new ListenerStub("400 APP_KEY");
            var dto      = CreateExceptionDTO();
            var e1       = new ErrorReportDTO("dsjklsdfl", dto,
                                              new[] { new ContextCollectionDTO("name1"), new ContextCollectionDTO("name2") });

            var url = new Uri($"http://localhost:{listener.ListenerPort}/");
            var sut = new UploadToCoderr(url, "cramply", "majs");

            try
            {
                sut.UploadReport(e1);
                listener.Wait(5000);
                throw new InvalidOperationException("Test failed");
            }
            catch (InvalidApplicationKeyException)
            {
            }
        }