public void report_parse_error_should_send_report_to_server()
        {
            const string badTitle = "Bad Title";

            ReportingService.ReportParseError(badTitle);
            MockedRestProvider.Verify(p => p.PostData(It.Is <string>(c => c.ToLower().StartsWith("http://services.nzbdrone.com/")), It.Is <ParseErrorReport>(c => c.Title == badTitle)), Times.Once());
        }
Ejemplo n.º 2
0
        public void unparsable_path_should_report_the_path()
        {
            Parser.ParsePath("C:\\").Should().BeNull();

            MockedRestProvider.Verify(c => c.PostData(It.IsAny <string>(), It.IsAny <ParseErrorReport>()), Times.Exactly(2));

            ExceptionVerification.IgnoreWarns();
        }
        public void report_parse_error_should_send_multiple_reports_if_titles_are_diffrent()
        {
            ReportingService.ReportParseError("title 1");
            ReportingService.ReportParseError("title 2");

            MockedRestProvider.Verify(p => p.PostData(It.IsAny <string>(), It.IsAny <ReportBase>()), Times.Exactly(2));
            MockedRestProvider.Verify(p => p.PostData(It.IsAny <string>(), It.Is <ParseErrorReport>(c => c.Title == "title 1")), Times.Once());
            MockedRestProvider.Verify(p => p.PostData(It.IsAny <string>(), It.Is <ParseErrorReport>(c => c.Title == "title 2")), Times.Once());
        }
        public void report_parse_error_should_send_duplicated_report_once_with_diffrent_casing()
        {
            const string badTitle = "Bad Title";

            ReportingService.ReportParseError(badTitle.ToUpper());
            ReportingService.ReportParseError(badTitle);

            MockedRestProvider.Verify(p => p.PostData(It.IsAny <string>(), It.IsAny <ReportBase>()), Times.Once());
        }
Ejemplo n.º 5
0
        public void unparsable_title_should_report_title()
        {
            const string TITLE = "SOMETHING";

            Parser.ParseTitle(TITLE).Should().BeNull();

            MockedRestProvider.Verify(c => c.PostData(It.IsAny <string>(), It.Is <ParseErrorReport>(r => r.Title == TITLE)), Times.Once());

            ExceptionVerification.IgnoreWarns();
        }