public void WhenContainerStopped_Runs() { Container.Stop(false); Container.Destroy(); ProcessRunner.Received(1).Dispose(); }
public void WhenContainerDestroyed_Throws() { Container.Destroy(); Action action = () => Container.GetInfo(); Assert.Throws <InvalidOperationException>(action); }
public void DisposesJobObject_ThisEnsuresWeCanDeleteTheDirectory() { Container.Destroy(); JobObject.Received(1).TerminateProcessesAndWait(); JobObject.Received(1).Dispose(); }
public void KillsProcesses() { Container.Destroy(); ProcessRunner.Received(1).StopAll(true); ConstrainedProcessRunner.Received(1).StopAll(true); }
public void DisposesRunners() { Container.Destroy(); ProcessRunner.Received(1).Dispose(); ConstrainedProcessRunner.Received(1).Dispose(); }
public void ThrowsInvalidOperationWhenIOExceptionThrownAndDestroyed() { Container.Destroy(); ContainerPropertiesService.GetProperties(Container).Returns(x => { throw new IOException(); }); Assert.Throws <InvalidOperationException>(() => Container.GetProperties()); }
public void DeletesDiskQuota() { var dskuser = Substitute.For <DIDiskQuotaUser>(); DiskQuotaControl.FindUser(User.SID).Returns(dskuser); Container.Destroy(); DiskQuotaControl.Received(1).DeleteUser(dskuser); }
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); }
public void DeletesFirewallRules() { Container.Destroy(); TcpPortManager.Received(1).RemoveFirewallRules(User.UserName); }
public void DeletesContainerDirectory() { Container.Destroy(); this.Directory.Received(1).Destroy(); }
public void DeletesUser() { Container.Destroy(); User.Received(1).Delete(); }
public void DeletesDiskQuota() { Container.Destroy(); ContainerDiskQuota.Received(1).DeleteQuota(); }
public void DeletesBindMounts() { Container.Destroy(); this.Directory.Received(1).DeleteBindMounts(this.bindMounts, this.User); }