Example #1
0
        public void GetCSS_DoesNotCallWebDownloader_WhenSchemeNotSupported()
        {
            string path = "chrome-extension://fcdjadjbdihbaodagojiomdljhjhjfho/css/atd.css";

            LinkTagCssSource sut = CreateSUT(path: path);

            sut.GetCss();

            _webDownloader.Verify(w => w.DownloadString(new Uri(path)), Times.Never);
        }
Example #2
0
        public void GetCSS_AbsoluteUrlInHref_CallsWebDownloader_WithSpecifiedPath()
        {
            string path = "http://b.co/a.css";

            LinkTagCssSource sut = CreateSUT(path: path);

            sut.GetCss();

            _webDownloader.Verify(w => w.DownloadString(new Uri(path)));
        }
Example #3
0
        public void GetCSS_CallsWebDownloader_WithSpecifiedPath()
        {
            string path = "b.css";

            LinkTagCssSource sut = CreateSUT(path: path);

            sut.GetCss();

            _webDownloader.Verify(w => w.DownloadString(It.Is <Uri>(u => u.PathAndQuery == "/" + path)));
        }
Example #4
0
        public void GetCSS_CallsWebDownloader_WithSpecifiedBundle()
        {
            string path = "/Content/css?v=7V7TZzP9Wo7LiH9_q-r5mRBdC_N0lA_YJpRL_1V424E1";

            LinkTagCssSource sut = CreateSUT(path: path, link: "<link href=\"{0}\" rel=\"stylesheet\"/>");

            sut.GetCss();

            _webDownloader.Verify(w => w.DownloadString(It.Is <Uri>(u => u.PathAndQuery == path)));
        }
Example #5
0
        public void GetCSS_CallsWebDownloader_WithSpecifiedDomain()
        {
            string baseUrl = "http://a.co";

            LinkTagCssSource sut = CreateSUT(baseUrl: baseUrl);

            sut.GetCss();

            _webDownloader.Verify(w => w.DownloadString(It.Is <Uri>(u => u.Scheme == "http" && u.Host == "a.co")));
        }