public void Should_return_previously_provided_handler() { // ReSharper disable once ConvertToLocalFunction EventHandler <ITestAbstraction> handler = (s, args) => { }; var mappedHandler = _lookup.MapForAttachment(handler, abstraction => ((sender, implementation) => abstraction(sender, new TestAdapter()))); var mappedHandlerForDetachment = _lookup.TryMapForDetachment(handler); mappedHandler.Should().Be(mappedHandlerForDetachment); }
public void Should_return_null_if_handler_is_null() { var handler = _lookup.MapForAttachment(null, abstraction => ((sender, impl) => abstraction(sender, new TestAdapter()))); handler.Should().BeNull(); }