コード例 #1
0
        public async Task GetLocationQuery_GetLocationByCity_Executes_Failure(string invalidCity)
        {
            // Arrange
            IGetLocationQuery query = new GetLocationQuery();

            // Act & Assert
            await Assert.ThrowsAsync <LocationByCityNotFoundError>(async() => await query.GetLocationByCity(invalidCity));
        }
コード例 #2
0
        public async Task GetLocationQuery_GetLocationByCity_Executes_Successfully(string city)
        {
            // Arrange
            IGetLocationQuery query = new GetLocationQuery();

            // Act
            var response = await query.GetLocationByCity(city);

            // Assert
            Assert.Equal(city, response.Title);
        }