public async Task Given_MultipleCitiesProvided_When_GetAddressCityGroups_Then_ReturnCorrectAddressGroups()
        {
            _jsonReader.ReadAllTextAsync(Arg.Any <string>()).Returns(Task.FromResult(
                                                                         await File.ReadAllTextAsync("AddressesWithDifferentCities.json")
                                                                         ));

            var result = await _sut.GetAddressCityGroups();

            Assert.AreEqual(2, result.Single(x => x.City == "city 1").Addresses.Count());
            Assert.AreEqual(1, result.Single(x => x.City == "city 2").Addresses.Count());
        }
Beispiel #2
0
    public async Task <List <Address> > GetAll()
    {
        var addressesJson = await _jsonReader.ReadAllTextAsync("Addresses.json");

        return(JsonConvert.DeserializeObject <List <Address> >(addressesJson));
    }