Example #1
0
        public void CloneTest()
        {
            ConnectedEventConfig config = new ConnectedEventConfig();
            ConnectedEventConfig clone  = config.Clone();

            Assert.AreNotSame(config, clone);
        }
Example #2
0
        // ---------------- Functions ----------------

        public void Init(PluginInitor pluginInit)
        {
            string configPath = Path.Combine(
                pluginInit.ChaskisConfigPluginRoot,
                "HttpServer",
                "HttpServerConfig.xml"
                );

            this.config = XmlLoader.LoadConfig(configPath);
            this.log    = pluginInit.Log;

            IChaskisEventCreator eventCreator = pluginInit.ChaskisEventCreator;

            ChaskisEventHandler coreEvent = eventCreator.CreateCoreEventHandler(
                ChaskisEventProtocol.IRC,
                this.OnConnect
                );

            this.handlers.Add(coreEvent);

            ConnectedEventConfig connectedEventConfig = new ConnectedEventConfig
            {
                ConnectedAction = this.OnConnect
            };

            this.handlers.Add(
                new ConnectedEventHandler(connectedEventConfig)
                );
        }
Example #3
0
        public void TestSetup()
        {
            this.ircConfig        = TestHelpers.GetTestIrcConfig();
            this.ircWriter        = new Mock <IIrcWriter>(MockBehavior.Strict);
            this.responseReceived = null;

            ConnectedEventConfig config = new ConnectedEventConfig
            {
                ConnectedAction = ConnectedFunction
            };

            this.uut = new ConnectedEventHandler(config);
        }
Example #4
0
        public void ValidateTest()
        {
            ConnectedEventConfig config = new ConnectedEventConfig();

            config.ConnectedAction = null;
            Assert.Throws <ListedValidationException>(() => config.Validate());

            config.ConnectedAction = delegate(ConnectedEventArgs args)
            {
            };

            Assert.DoesNotThrow(() => config.Validate());
        }