コード例 #1
0
        public void Should_Create_AppPool()
        {
            // Arrange
            var settings = CakeHelper.GetAppPoolSettings();

            CakeHelper.DeletePool(settings.Name);

            // Act
            CakeHelper.CreateApplicationPoolManager().Create(settings);

            // Assert
            Assert.NotNull(CakeHelper.GetPool(settings.Name));
        }
コード例 #2
0
        public void Should_Create_Delete_AppPool()
        {
            // Arrange
            var settings = CakeHelper.GetAppPoolSettings("Bart");

            // Create
            CakeHelper.CreateApplicationPoolManager().Create(settings);
            CakeHelper.GetPool(settings.Name).ShouldNotBeNull();

            // Delete
            CakeHelper.DeletePool(settings.Name);
            CakeHelper.GetPool(settings.Name).ShouldBeNull();
        }
コード例 #3
0
        public void Should_Stop_AppPool()
        {
            // Arrange
            var settings = CakeHelper.GetAppPoolSettings("Marg");

            CakeHelper.CreatePool(settings);
            CakeHelper.StartPool(settings.Name);

            // Act
            CakeHelper.CreateApplicationPoolManager().Stop(settings.Name);

            // Assert
            ApplicationPool pool = CakeHelper.GetPool(settings.Name);

            pool.ShouldNotBeNull();
            pool.State.ShouldBe(ObjectState.Stopped);

            CakeHelper.DeletePool(settings.Name);
        }
コード例 #4
0
        public void Should_Start_AppPool()
        {
            // Arrange
            var settings = CakeHelper.GetAppPoolSettings("Homer");

            CakeHelper.CreatePool(settings);
            CakeHelper.StopPool(settings.Name);

            // Act
            CakeHelper.CreateApplicationPoolManager().Start(settings.Name);

            // Assert
            ApplicationPool pool = CakeHelper.GetPool(settings.Name);

            Assert.NotNull(pool);
            Assert.True(pool.State == ObjectState.Started);

            CakeHelper.DeletePool(settings.Name);
        }