public void When_using_strongly_typed_OnSendingHeaders_it_should_be_invoked_at_sending_headers() { var owinResponse = new OwinResponse(); owinResponse.Environment["server.OnSendingHeaders"] = new Action <Action <object>, object>((action, obj) => action(obj)); owinResponse.OnSendingHeaders(str => { str.ShouldBeTypeOf(typeof(string)); str.ShouldBe("Strongly typed!"); }, "Strongly typed!"); }