Ejemplo n.º 1
0
            public void WhenContainerStopped_Runs()
            {
                Container.Stop(false);
                Container.Destroy();

                ProcessRunner.Received(1).Dispose();
            }
Ejemplo n.º 2
0
            public void WhenContainerDestroyed_Throws()
            {
                Container.Destroy();
                Action action = () => Container.GetInfo();

                Assert.Throws <InvalidOperationException>(action);
            }
Ejemplo n.º 3
0
            public void DisposesJobObject_ThisEnsuresWeCanDeleteTheDirectory()
            {
                Container.Destroy();

                JobObject.Received(1).TerminateProcessesAndWait();
                JobObject.Received(1).Dispose();
            }
Ejemplo n.º 4
0
            public void KillsProcesses()
            {
                Container.Destroy();

                ProcessRunner.Received(1).StopAll(true);
                ConstrainedProcessRunner.Received(1).StopAll(true);
            }
Ejemplo n.º 5
0
            public void DisposesRunners()
            {
                Container.Destroy();

                ProcessRunner.Received(1).Dispose();
                ConstrainedProcessRunner.Received(1).Dispose();
            }
Ejemplo n.º 6
0
            public void ThrowsInvalidOperationWhenIOExceptionThrownAndDestroyed()
            {
                Container.Destroy();
                ContainerPropertiesService.GetProperties(Container).Returns(x => { throw new IOException(); });

                Assert.Throws <InvalidOperationException>(() => Container.GetProperties());
            }
Ejemplo n.º 7
0
            public void DeletesDiskQuota()
            {
                var dskuser = Substitute.For <DIDiskQuotaUser>();

                DiskQuotaControl.FindUser(User.SID).Returns(dskuser);

                Container.Destroy();

                DiskQuotaControl.Received(1).DeleteUser(dskuser);
            }
Ejemplo n.º 8
0
            public void ReleasesPorts()
            {
                TcpPortManager.ReserveLocalPort(Arg.Any <int>(), Arg.Any <string>())
                .Returns(c => c.Arg <int>());

                Container.ReservePort(100);
                Container.ReservePort(101);

                Container.Destroy();

                TcpPortManager.Received(1).ReleaseLocalPort(100, User.UserName);
                TcpPortManager.Received(1).ReleaseLocalPort(101, User.UserName);
            }
Ejemplo n.º 9
0
 public void DeletesFirewallRules()
 {
     Container.Destroy();
     TcpPortManager.Received(1).RemoveFirewallRules(User.UserName);
 }
Ejemplo n.º 10
0
            public void DeletesContainerDirectory()
            {
                Container.Destroy();

                this.Directory.Received(1).Destroy();
            }
Ejemplo n.º 11
0
            public void DeletesUser()
            {
                Container.Destroy();

                User.Received(1).Delete();
            }
Ejemplo n.º 12
0
 public void DeletesDiskQuota()
 {
     Container.Destroy();
     ContainerDiskQuota.Received(1).DeleteQuota();
 }
Ejemplo n.º 13
0
            public void DeletesBindMounts()
            {
                Container.Destroy();

                this.Directory.Received(1).DeleteBindMounts(this.bindMounts, this.User);
            }