public void TestModuleUsingAttributes()
        {
            MockModuleUsingAttributes module = new MockModuleUsingAttributes();
            ModuleCoordinator coordinator = new ModuleCoordinator();
            coordinator.AddModule("TestModule", module);
            coordinator.StartAll();
            coordinator.PostMessage("TestModule", "TestMessage");
            coordinator.PostMessage("TestModule", 77);
            System.Threading.Thread.Sleep(100);
            coordinator.StopAll();

            Assert.AreSame(coordinator, module.ModuleCoordinator);
            Assert.AreEqual(2, module.ReceivedMessages.Count);
            Assert.IsInstanceOfType(typeof(string), module.ReceivedMessages[0]);
            Assert.AreEqual("TestMessage", (string)module.ReceivedMessages[0]);

            Assert.IsInstanceOfType(typeof(int), module.ReceivedMessages[1]);
            Assert.AreEqual(77, (int)module.ReceivedMessages[1]);
        }
        public void TestModuleUsingAttributes()
        {
            MockModuleUsingAttributes module      = new MockModuleUsingAttributes();
            ModuleCoordinator         coordinator = new ModuleCoordinator();

            coordinator.AddModule("TestModule", module);
            coordinator.StartAll();
            coordinator.PostMessage("TestModule", "TestMessage");
            coordinator.PostMessage("TestModule", 77);
            System.Threading.Thread.Sleep(100);
            coordinator.StopAll();

            Assert.AreSame(coordinator, module.ModuleCoordinator);
            Assert.AreEqual(2, module.ReceivedMessages.Count);
            Assert.IsInstanceOfType(typeof(string), module.ReceivedMessages[0]);
            Assert.AreEqual("TestMessage", (string)module.ReceivedMessages[0]);

            Assert.IsInstanceOfType(typeof(int), module.ReceivedMessages[1]);
            Assert.AreEqual(77, (int)module.ReceivedMessages[1]);
        }
 public void SetUp()
 {
     m_suicidalModule = new MockSuicidalModule();
     m_moduleCoordinator = new ModuleCoordinator();
 }
Exemple #4
0
 public void SetUp()
 {
     m_scheduledMessageReceiver = new MockScheduledMessageReceiver();
     m_moduleCoordinator        = new ModuleCoordinator();
 }
 public void SetUp()
 {
     m_scheduledMessageReceiver = new MockScheduledMessageReceiver();
     m_moduleCoordinator = new ModuleCoordinator();
 }
 public void SetUp()
 {
     m_suicidalModule    = new MockSuicidalModule();
     m_moduleCoordinator = new ModuleCoordinator();
 }