JasperFx / alba

Easy integration testing for ASP.NET Core applications
https://jasperfx.github.io/alba
Apache License 2.0
406 stars 39 forks source link

Change HttpContext.Items to not throw KeyNotFoundException #47

Closed joemcbride closed 6 years ago

joemcbride commented 6 years ago

Some libraries apparently rely upon the implementation of HttpContext.Items to not throw. Alba's implementation throws an error if a key does not exist. Change this to something that does not throw.

joemcbride commented 6 years ago

ItemsDictionary implementation

https://github.com/aspnet/HttpAbstractions/blob/87cd79d6fc54bb4abf07c1e380cd7a9498a78612/src/Microsoft.AspNetCore.Http/Internal/ItemsDictionary.cs