Пример #1
0
        public async Task Get_carbon_intensity_live_zone_Async(
            string zone,
            LiveCarbonIntensity data)
        {
            httpFacade
            .GetAsync <LiveCarbonIntensity>(Arg.Any <Uri>())
            .Returns(data);

            var result = await sut
                         .GetLiveCarbonIntensityAsync(zone)
                         .ConfigureAwait(false);

            result.Should().NotBeNull();
            result.Should().Be(data);
        }
Пример #2
0
        public async Task Get_carbon_intensity_live_lat_long_Async(
            double latitude,
            double longitude,
            LiveCarbonIntensity data)
        {
            httpFacade
            .GetAsync <LiveCarbonIntensity>(Arg.Any <Uri>())
            .Returns(data);

            var result = await sut
                         .GetLiveCarbonIntensityAsync(latitude, longitude)
                         .ConfigureAwait(false);

            result.Should().NotBeNull();
            result.Should().Be(data);
        }
Пример #3
0
 public async Task OnGet()
 {
     LiveCarbonIntensity = await _electricityMapClient.GetLiveCarbonIntensityAsync(ZoneConstants.Denmark_East_Denmark);
 }