Last active
August 29, 2015 14:01
-
-
Save moodmosaic/2789ba06980880217df7 to your computer and use it in GitHub Desktop.
F# port of @ploeh's answer at http://stackoverflow.com/a/20723447/467754 for ASP.NET Web API 2.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // F# port of @ploeh's answer at http://stackoverflow.com/a/20723447/467754 for ASP.NET Web API 2. | |
| type WebApiCustomization() = | |
| interface ICustomization with | |
| member this.Customize fixture = | |
| fixture.Customize<HttpConfiguration>(fun c -> | |
| c.OmitAutoProperties() :> ISpecimenBuilder) | |
| fixture.Customize<HttpRequestMessage>(fun c -> | |
| c.Do(fun (x : HttpRequestMessage) -> | |
| x.Properties.[HttpPropertyKeys.HttpConfigurationKey] <- | |
| fixture.Create<HttpConfiguration>()) | |
| :> ISpecimenBuilder) | |
| fixture.Customize<HttpRequestContext>(fun c -> | |
| c.Without(fun x -> x.ClientCertificate) :> ISpecimenBuilder) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment