-
-
Save dcomartin/f60e7020b3f962709ad0757236b46ece 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 Tests | |
| { | |
| [Fact] | |
| public async Task Lookup_returns_mapped_result_when_response_is_successful() | |
| { | |
| var json = """ | |
| { | |
| "year": 2026, | |
| "make": "Ford", | |
| "model": "F-150" | |
| } | |
| """; | |
| var handler = new StubHttpMessageHandler(_ => | |
| new HttpResponseMessage(HttpStatusCode.OK) | |
| { | |
| Content = new StringContent(json, Encoding.UTF8, "application/json") | |
| }); | |
| var httpClient = new HttpClient(handler); | |
| var sut = new VinDecoder(httpClient); | |
| var result = await sut.Lookup("123456789"); | |
| Assert.Equal(2026, result.Year); | |
| Assert.Equal("Ford", result.Make); | |
| Assert.Equal("F-150", result.Model); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment