public void PublishInstanceChangedEvent__CorrectlyPublished() { var correctlyPublished = false; var givenArgs = new InstanceChangedEventArgs <IData>(TerminalDescriptor, Data); TestInstance.InstanceChangedEvent += (sender, args) => correctlyPublished = sender == TestInstance && args == givenArgs; TestInstance.PublishInstanceChangedEvent(givenArgs); Assert.IsTrue(correctlyPublished); }
public void PublishInstanceChangedEvent_NoSubscribers_NoError() { var caught = false; var args = new InstanceChangedEventArgs <IData>(TerminalDescriptor, Data); try { TestInstance.PublishInstanceChangedEvent(args); } catch { caught = true; } Assert.IsFalse(caught); }