public void CloneTest() { ConnectedEventConfig config = new ConnectedEventConfig(); ConnectedEventConfig clone = config.Clone(); Assert.AreNotSame(config, clone); }
// ---------------- 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) ); }
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); }
public void ValidateTest() { ConnectedEventConfig config = new ConnectedEventConfig(); config.ConnectedAction = null; Assert.Throws <ListedValidationException>(() => config.Validate()); config.ConnectedAction = delegate(ConnectedEventArgs args) { }; Assert.DoesNotThrow(() => config.Validate()); }