Beispiel #1
0
        public void ShutDownAndRestart_WillStartNewProcessWithStartArgument_WithoutSpecifyingStartArguments()
        {
            var stubSingleInstanceGuard = new Mock <ISingleAppInstanceGuard>();
            var restarter = new Fake_AppRestarter();

            restarter.Init(stubSingleInstanceGuard.Object);

            restarter.ShutDownAndRestart(null);

            Assert.AreEqual(TimeMerge.App.NightlyRestart, restarter.CalledAppStartParams[0]);
        }
Beispiel #2
0
        public void ShutDownAndRestart_WillStartNewProcessAfterShuttingDownThisOne_Always()
        {
            var stubSingleInstanceGuard = new Mock <ISingleAppInstanceGuard>();
            var restarter = new Fake_AppRestarter();

            restarter.Init(stubSingleInstanceGuard.Object);

            restarter.ShutDownAndRestart(null);

            Assert.IsTrue(restarter.CalledAppStartTimeOffset != TimeSpan.Zero);
            Assert.IsTrue(restarter.CalledAppShutdownTimeOffset != TimeSpan.Zero);
            Assert.IsTrue(restarter.CalledAppStartTimeOffset > restarter.CalledAppShutdownTimeOffset);
        }
Beispiel #3
0
        public void ShutDownAndRestart_WillStartNewProcessWithStartArgument_WhenStartArgumentSpecified()
        {
            var stubSingleInstanceGuard = new Mock <ISingleAppInstanceGuard>();
            var restarter = new Fake_AppRestarter();

            restarter.Init(stubSingleInstanceGuard.Object);

            restarter.ShutDownAndRestart("/dummyParam");

            Assert.AreEqual("/dummyParam", restarter.CalledAppStartParams[0]);
            Assert.AreEqual(TimeMerge.App.NightlyRestart, restarter.CalledAppStartParams[1]);
            Assert.AreEqual(2, restarter.CalledAppStartParams.Count);
        }