Ejemplo n.º 1
0
            public void WillCacheTheSiteRootLookup()
            {
                var configuration = new TestableConfiguration();
                configuration.GetSiteRoot(useHttps: false);
                
                configuration.GetSiteRoot(useHttps: true);

                configuration.StubRequest.Verify(stub => stub.IsLocal, Times.Once());
            }
            public void WillCacheTheSiteRootLookup()
            {
                var configuration = new TestableConfiguration();

                configuration.GetSiteRoot(useHttps: false);

                configuration.GetSiteRoot(useHttps: true);

                configuration.StubRequest.Verify(stub => stub.IsLocal, Times.Once());
            }
Ejemplo n.º 3
0
            public void WillThrowIfConfiguredSiteRootIsNotHttpOrHttps()
            {
                var configuration = new TestableConfiguration();
                configuration.StubConfiguredSiteRoot = "ftp://theSiteRoot/";

                Assert.Throws<InvalidOperationException>(() => configuration.GetSiteRoot(useHttps: false));
            }
            public void WillThrowIfConfiguredSiteRootIsNotHttpOrHttps()
            {
                var configuration = new TestableConfiguration();

                configuration.StubConfiguredSiteRoot = "ftp://theSiteRoot/";

                Assert.Throws <InvalidOperationException>(() => configuration.GetSiteRoot(useHttps: false));
            }
Ejemplo n.º 5
0
            public void WillUseHttpUponRequestWhenConfiguredSiteRootIsHttps()
            {
                var configuration = new TestableConfiguration();
                configuration.StubConfiguredSiteRoot = "https://theSiteRoot/";

                var siteRoot = configuration.GetSiteRoot(useHttps: false);

                Assert.Equal("http://theSiteRoot/", siteRoot);
            }
Ejemplo n.º 6
0
            public void WillGetTheConfiguredHttpsSiteRoot()
            {
                var configuration = new TestableConfiguration();
                configuration.StubConfiguredSiteRoot = "http://theSiteRoot/";

                var siteRoot = configuration.GetSiteRoot(useHttps: true);

                Assert.Equal("https://theSiteRoot/", siteRoot);
            }
Ejemplo n.º 7
0
            public void WillUseTheActualRootWhenTheRequestIsLocal()
            {
                var configuration = new TestableConfiguration();
                configuration.StubRequest.Setup(stub => stub.IsLocal).Returns(true);
                configuration.StubRequest.Setup(stub => stub.Url).Returns(new Uri("http://theLocalSiteRoot/aPath"));

                var siteRoot = configuration.GetSiteRoot(useHttps: true);

                Assert.Equal("https://thelocalsiteroot/", siteRoot);
            }
            public void WillUseHttpUponRequestWhenConfiguredSiteRootIsHttps()
            {
                var configuration = new TestableConfiguration();

                configuration.StubConfiguredSiteRoot = "https://theSiteRoot/";

                var siteRoot = configuration.GetSiteRoot(useHttps: false);

                Assert.Equal("http://theSiteRoot/", siteRoot);
            }
            public void WillGetTheConfiguredHttpsSiteRoot()
            {
                var configuration = new TestableConfiguration();

                configuration.StubConfiguredSiteRoot = "http://theSiteRoot/";

                var siteRoot = configuration.GetSiteRoot(useHttps: true);

                Assert.Equal("https://theSiteRoot/", siteRoot);
            }
            public void WillUseTheActualRootWhenTheRequestIsLocal()
            {
                var configuration = new TestableConfiguration();

                configuration.StubRequest.Setup(stub => stub.IsLocal).Returns(true);
                configuration.StubRequest.Setup(stub => stub.Url).Returns(new Uri("http://theLocalSiteRoot/aPath"));

                var siteRoot = configuration.GetSiteRoot(useHttps: true);

                Assert.Equal("https://thelocalsiteroot/", siteRoot);
            }