public void CanBindSpecificSources() { IBinder binder = new SourceBinder(new string[] { "Source 1", "Source 2" }); Assert.IsFalse(binder.CanBind(new Message(MessageSeverity.CriticalError, string.Empty))); Assert.IsTrue(binder.CanBind(new Message(MessageSeverity.CriticalError, "Source 1"))); Assert.IsFalse(binder.CanBind(new Message(MessageSeverity.CriticalError, null))); Assert.IsTrue(binder.CanBind(new Message(MessageSeverity.CriticalError, "Source 2"))); }
public void CanBind() { IBinder binder = new SourceBinder(null); Assert.IsTrue(binder.CanBind(new TextMessage(MessageSeverity.Debug, string.Empty, DateTime.Now, string.Empty))); Assert.IsTrue(binder.CanBind(new Message())); binder = new SourceBinder(new string[] {}); Assert.IsTrue(binder.CanBind(new TextMessage(MessageSeverity.Debug, string.Empty, DateTime.Now, string.Empty))); Assert.IsTrue(binder.CanBind(new Message())); }