Ejemplo n.º 1
0
            public void DoesNotStartGuardIfAlreadyRunning()
            {
                Container.StartGuard();
                Container.StartGuard();

                ProcessRunner.Received(1).Run(Arg.Any <ProcessRunSpec>());
            }
Ejemplo n.º 2
0
            public void WhenGuardIsRunning_Throws()
            {
                Container.StartGuard();

                Action action = () => Container.LimitMemory(3000);

                Assert.Throws <InvalidOperationException>(action);
            }
Ejemplo n.º 3
0
            public void StartsExeWithCorrectOptions()
            {
                JobObject.GetJobMemoryLimit().Returns(6789UL);
                Container.StartGuard();

                var actual = ProcessRunner.Captured(x => x.Run(null)).Arg <ProcessRunSpec>();

                Assert.Equal(@"C:\Containers\handle\bin\Guard.exe", actual.ExecutablePath);
                Assert.Equal(2, actual.Arguments.Length);
                Assert.Equal(_containerUsername, actual.Arguments[0]);
                Assert.Equal(Container.Id, actual.Arguments[1]);
                Assert.Equal(@"C:\Containers\handle\user\", actual.WorkingDirectory);
                Assert.Null(actual.Credentials);
            }