public async System.Threading.Tasks.Task GetContinent_ReturnSpecificContinent() { #region Arrange var expectedContinent = new Continent { code = "AF", name = "Africa" }; #endregion #region Act var result = await _graphQLRepository.GetContinentByCodeAsync(expectedContinent.code); #endregion #region Assert result.Should().BeEquivalentTo(expectedContinent, c => c.Excluding(continent => continent.countries)); result.countries.Should().NotBeNullOrEmpty(); #endregion }
/// <summary> /// Get Continent by continent's code /// </summary> /// <param name="code">continent's code</param> /// <returns>Requested Continent, if not exist return null</returns> public async Task <Continent> GetContinentByCodeAsync(string code) { _logger.Verbose("Get continent by code:{continentCode}", code.ToUpper()); return(await _repo.GetContinentByCodeAsync(code)); }