Ejemplo n.º 1
0
        public void GetRoomMeasure_With_Bad_Type_Should_Throw_ArgumentException()
        {
            var sut = new Netatmo.EnergyClient("https://api.netatmo.com/", credentialManagerMock.Object);

            sut
            .Awaiting(async s => await s.GetRoomMeasure <DateTemperatureStep>(new GetRoomMeasureParameters
            {
                HomeId = "5a327cbdb05a2133678b5d3e",
                RoomId = "2255031728",
                Scale  = Scale.Max,
                Type   = ThermostatMeasurementType.Temperature
            }))
            .Should().Throw <ArgumentException>()
            .WithMessage("TemperatureStep should be used with a temperature measurement");
            sut
            .Awaiting(async s => await s.GetRoomMeasure <TemperatureStep>(new GetRoomMeasureParameters
            {
                HomeId = "5a327cbdb05a2133678b5d3e",
                RoomId = "2255031728",
                Scale  = Scale.OneMonth,
                Type   = ThermostatMeasurementType.DateMinTemp
            }))
            .Should().Throw <ArgumentException>()
            .WithMessage("DateTemperatureStep should be used with a date of temperature measurement");
        }
Ejemplo n.º 2
0
        public void GetRoomMeasure_Should_Throw_ArgumentException(GetRoomMeasureParameters parameters, string exceptionMessage)
        {
            var sut = new Netatmo.EnergyClient("https://api.netatmo.com/", credentialManagerMock.Object);

            sut
            .Awaiting(async s => await s.GetRoomMeasure <TemperatureStep>(parameters))
            .Should().Throw <ArgumentException>()
            .WithMessage(exceptionMessage);
        }