コード例 #1
0
        public void OnPhysicalPath_ThrowsIfPathDoesNotExist()
        {
            var application = WebAdministrationFactory.CreateApplication();
            var sut         = new ApplicationConfigurer(application);

            Assert.Throws <DirectoryNotFoundException>(() => sut.OnPhysicalPath("C:\\mySite282829"));
        }
コード例 #2
0
        public void UseApplicationPool_SetsTheApplicationPoolName()
        {
            var application = WebAdministrationFactory.CreateApplication();
            var sut         = new ApplicationConfigurer(application);

            sut.UseApplicationPool("TestApplicationPool");

            Assert.Equal("TestApplicationPool", application.ApplicationPoolName);
        }
コード例 #3
0
        public void OnPhysicalPath_SetsTheApplicationsVirtualDirectoryPhysicalPath()
        {
            var application = WebAdministrationFactory.CreateApplication();
            var sut         = new ApplicationConfigurer(application);

            sut.OnPhysicalPath(@"C:\");

            Assert.Equal(@"C:\", application.VirtualDirectory().PhysicalPath);
        }
コード例 #4
0
        public void UseAlias_WithForwardSlashSetsThePathCorrectly()
        {
            var application = WebAdministrationFactory.CreateApplication();
            var sut         = new ApplicationConfigurer(application);

            sut.UseAlias("/TestAlias");

            Assert.Equal("/TestAlias", application.Path);
        }
コード例 #5
0
        public void Configure_GivesDirectAccessToTheWebsite()
        {
            var expected = WebAdministrationFactory.CreateApplication();
            var sut      = new ApplicationConfigurer(expected);
            var actual   = default(Application);

            sut.Configure(x => actual = x);

            Assert.Equal(expected, actual);
        }
コード例 #6
0
 public void SutIsApplicationConfigurer()
 {
     Assert.IsAssignableFrom <IApplicationConfigurer>(
         new ApplicationConfigurer(WebAdministrationFactory.CreateApplication()));
 }