public void ShutDown_WillNotifySingleInstanceGuard_Always() { var spySingleInstanceGuard = new Mock <ISingleAppInstanceGuard>(); var restarter = new Fake_AppRestarter(); restarter.Init(spySingleInstanceGuard.Object); restarter.ShutDown(); spySingleInstanceGuard.Verify(g => g.OnBeforeAppShutDown(), Times.Exactly(1)); }
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]); }
public void ShutDown_WillCallAppShutdown_Always() { var stubSingleInstanceGuard = new Mock <ISingleAppInstanceGuard>(); var restarter = new Fake_AppRestarter(); restarter.Init(stubSingleInstanceGuard.Object); restarter.ShutDown(); Assert.IsTrue(restarter.CalledAppShutdown); }
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); }
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); }