public void TestModuleManager_SingleModuleEnabled() { /* GIVEN */ config = new GlobalModuleConfiguration { EnabledModules = new[] { typeof(TestModuleOne) } }; Compose(); /* PRECONDITION */ Debug.Assert(module1?.Mock != null); Debug.Assert(module2?.Mock != null); Debug.Assert(manager != null); /* WHEN */ manager.InitializeModules(); /* THEN */ module1.Mock.Verify(mock => mock.Initialize(true)); module2.Mock.Verify(mock => mock.Initialize(false)); }
public void TestModuleManager_NotifyModulesOnSessionStop() { /* GIVEN */ config = new GlobalModuleConfiguration { EnabledModules = new[] { typeof(TestModuleTwo) } }; Compose(); /* PRECONDITION */ Debug.Assert(module1?.Mock != null); Debug.Assert(module2?.Mock != null); Debug.Assert(manager != null); /* WHEN */ manager.InitializeModules(); manager.NotifyModulesOnSessionStop(); /* THEN */ module1.Mock.VerifySet(mock => mock.IsActive = false, Times.Never); module2.Mock.VerifySet(mock => mock.IsActive = false, Times.Once); }