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