Esempio n. 1
0
        public override void Context()
        {
            var mockProtoServer = new Mock<ProtoServer>();
            mockProtoServer.Setup(x => x.RegisterProtoTask(It.IsAny<ProtoTask>()))
                .Callback<ProtoTask>(t => _protoTask = t);
            var mockPhysServer = new Mock<PhysicalServer>();
            mockPhysServer.Setup(x => x.AddTask(It.IsAny<Iis7Task>()))
                .Callback<Task>(t => _iisTask = (Iis7Task)t);
            mockPhysServer.Setup(x => x.Name).Returns("localhost");

            _protoServer = mockProtoServer.Object;
            _physicalServer = mockPhysServer.Object;
        }
Esempio n. 2
0
        public void Create_A_VirtualDiretory_withClassic()
        {
            var task = new Iis7Task
                           {
                               PathOnServer = "C:\\SomethingAwesome",
                               ServerName = "localhost",
                               VdirPath = "Victastic",
                               WebsiteName = "SCOTT",
                               AppPoolName = "VICKERS",
                               //could be set on either website or vdir basis
                               UseClassicPipeline = true
                           };
            DeploymentResult output = task.Execute();

            foreach (var item in output.Results)
            {
                Console.WriteLine(item.Message);
            }
        }
Esempio n. 3
0
        public void NAME()
        {
            if(Directory.Exists(".\\bob"))
                Directory.Delete(".\\bob", true);

            Directory.CreateDirectory(".\\bob");
            var task = new Iis7Task
                       {
                           PathOnServer = new DirectoryInfo(".\\bob"),
                           ServerName = Environment.MachineName,
                           VdirPath = "bob",
                           WebsiteName = "Default Web Site"
                       };
            var output = task.Execute();
            foreach (var item in output.Results)
            {
                Console.WriteLine(item.Message);
            }
        }
Esempio n. 4
0
        public void Create_A_VirtualDiretory()
        {
            var task = new Iis7Task
                           {
                               PathOnServer = "C:\\SomethingAwesome",
                               ServerName = "localhost",
                               VirtualDirectoryPath = "Victastic",
                               WebsiteName = "Default Web Site",
                               AppPoolName = "VICKERS",
                               //could be set on either website or vdir basis
                               ManagedRuntimeVersion = ManagedRuntimeVersion.V4,
                               Enable32BitAppOnWin64 = true
                           };
            DeploymentResult output = task.Execute();

            foreach (var item in output.Results)
            {
                Console.WriteLine(item.Message);
            }
        }
        public override void Context()
        {
            var task = new Iis7Task
                       	{
                            PathOnServer = OldPath,
                            ServerName = WebServer,
                            VdirPath = VirtualDirectory,
                            AppPoolName = OldAppPool,
                            ManagedRuntimeVersion = OldManagedRuntimeVersion,
                            WebsiteName = WebSiteName,
                            Enable32BitAppOnWin64 = Old32bitOn64,
                            UseClassicPipeline = OldManagedPipelineMode == ManagedPipelineMode.Classic
                       	};
            var output = task.Execute();

            foreach (var item in output.Results)
            {
                System.Console.WriteLine(item.Message);
            }
        }
Esempio n. 6
0
 public override void Context()
 {
     WebServerName = "localhost";
     CertificateThumbprint = System.Configuration.ConfigurationManager.AppSettings["Iis7Task.LocalCertificateThumbprint"];
     Task = new Iis7Task { WebsiteName = TestWebSiteName, ServerName = WebServerName };
 }
            public override void Because()
            {
                var task = new Iis7Task
                {
                    PathOnServer = NewPath,
                    ServerName = WebServer,
                    VirtualDirectoryPath = VirtualDirectory,
                    AppPoolName = NewAppPool,
                    ManagedRuntimeVersion = NewManagedRuntimeVersion,
                    WebsiteName = WebSiteName,
                    Enable32BitAppOnWin64 = New32bitOn64,
                    UseClassicPipeline = NewManagedPipelineMode == ManagedPipelineMode.Classic
                };

                var output = task.Execute();

                foreach (var item in output.Results)
                {
                    Console.WriteLine(item.Message);
                }

                LoadVirtualDirectory();
            }