public async Task Test2() { var iata = this.fixture.Create <string>(); var repository = new PointLocationRepository(this.cacheMock.Object); this.SetupCacheGetAsyncMethod(null !); var location = await repository.GetAsync(iata, CancellationToken.None); location.Should().BeOfType <Maybe <Location> >(); location.Should().Be(Maybe <Location> .None); }
public async Task Test1() { var iata = this.fixture.Create <string>(); var expectedValue = this.fixture.Create <Location>(); var expectedValueEncoded = Encoding.UTF8.GetBytes(JsonSerializer.Serialize(expectedValue)); var repository = new PointLocationRepository(this.cacheMock.Object); this.SetupCacheGetAsyncMethod(expectedValueEncoded); var location = await repository.GetAsync(iata, CancellationToken.None); location.Value.Should().BeEquivalentTo(expectedValue); }