Skip to content
This repository has been archived by the owner on Apr 29, 2020. It is now read-only.

Commit

Permalink
Set up the mocked Sensor in the test. But got error message 'System.N…
Browse files Browse the repository at this point in the history
…otSupportedException : Invalid setup on a non-virtual (overridable in VB) member: s => s.PopNextPressurePsiValue()'. Will extract interface for class Sensor.
  • Loading branch information
wubin28 committed Apr 16, 2014
1 parent 01aa6f4 commit 412ae9f
Showing 1 changed file with 4 additions and 0 deletions.
Expand Up @@ -16,6 +16,10 @@ public void WHEN_check_pressure_value_in_alarm_THEN_get_characterization_of_whet
var sensor = new Mock<Sensor>();
var alarm = new Alarm(sensor.Object);

sensor
.Setup(s => s.PopNextPressurePsiValue())
.Returns(16.0);

// When
alarm.Check();

Expand Down

0 comments on commit 412ae9f

Please sign in to comment.