public void ShouldAddRemoveCollector() { var collector = new Mock <IMetadataCollector <long> >(); var handler = new TestHandler(); handler.AddCollector <IMetadataCollector <long>, long>(collector.Object); handler.RemoveCollector <IMetadataCollector <long>, long>(); var metadata = new Dictionary <string, object> { { "x", 1 }, { "y", false } }; handler.OnSuccess(metadata); collector.Verify(x => x.Collect(metadata), Times.Never); }