Last active
August 7, 2023 05:44
-
-
Save stijnmoreels/57515751f0b17022e11271d12c242e35 to your computer and use it in GitHub Desktop.
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
| public class MyTestContext | |
| { | |
| private readonly Arg<string> _tag = Arg.String.Default(Gen.Tag.Generate()); | |
| private readonly Arg<DateTimeOffset> _before = Arg.Date.Ignore(); | |
| public static MyTestContext Given() | |
| { | |
| return new MyTestContext(); | |
| } | |
| public void WhenTag(string tag) | |
| { | |
| _tag.TryOverwrite(tag); | |
| _tag.PreserveValue(); | |
| } | |
| public void WhenRequest(string tag = null, DateTimeOffset? before = null) | |
| { | |
| _tag.TryOverwrite(tag); | |
| _before.TryOverwrite(before); | |
| } | |
| public async Task ShouldRespondWithAsync(Func<HttpResponseMessage, Task> assertionAsync) | |
| { | |
| var request = new HttpRequestMessage(HttpMethod.Get, $"http://localhost:1234/api/app?tag={_tag}&before={_before}"); | |
| // Ignore this; out of scope. | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment