Beispiel #1
0
        public void ShouldSetGrillTemp()
        {
            // Arrange
            var sut = new GrillEmulator(currentGrillTemp: 0);

            // Act
            var initialState = sut.CurrentGrillTemp;
            var request      = new SetGrillTempRequest(temp: 200);

            var response = sut.HandleRequest(request) as MessageResponse;

            // Assert
            Assert.NotNull(response);
            Assert.Equal(0, initialState);
            Assert.Equal(200, sut.CurrentGrillTemp);
            Assert.Equal(Constants.ResponseCodes.OK, response.Message);
        }
Beispiel #2
0
 public IResponse HandleRequest(SetGrillTempRequest request)
 {
     TargetGrillTemp = request.DesiredTemperature;
     InterpolateTargetToCurrentGtillTemp();
     return(new MessageResponse("OK"));
 }