Skip to content

Commit

Permalink
test(api): update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
steveoh committed Aug 13, 2024
1 parent a3188cd commit 1d88698
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace api.tests.Features.Geocoding;
public class AddressSystemFromPlaceTests {
public AddressSystemFromPlaceTests() {
var mockDb = new Mock<IDatabase>();
mockDb.Setup(x => x.StringGetAsync(It.Is<RedisKey>(p => p.Equals(new RedisKey("place"))), CommandFlags.None))
mockDb.Setup(x => x.StringGetAsync(It.Is<RedisKey>(p => p.Equals(new RedisKey("map/place/key"))), CommandFlags.None))
.ReturnsAsync(new RedisValue("grid,0"));

var mockConnection = new Mock<IConnectionMultiplexer>();
Expand All @@ -32,15 +32,15 @@ public async Task Should_return_empty_when_zip_is_null() {

[Fact]
public async Task Should_return_empty_when_zip_not_found() {
var request = new AddressSystemFromPlace.Computation("other place");
var request = new AddressSystemFromPlace.Computation("key-not-found");
var result = await _handler.Handle(request, CancellationToken.None);

result.ShouldBeEmpty();
}

[Fact]
public async Task Should_return_grid_from_place() {
var request = new AddressSystemFromPlace.Computation("place");
var request = new AddressSystemFromPlace.Computation("key");
var result = await _handler.Handle(request, CancellationToken.None);

result.Count.ShouldBe(1);
Expand Down

0 comments on commit 1d88698

Please sign in to comment.