コード例 #1
0
        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));
        }
コード例 #2
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);
        }