public void SetUp() { _behavior = new TimeChangeBehavior(); _testableClock = new TestableClock(); _clockDisplay = A.Fake <IClockDisplay>(); _testableClock.Display = _clockDisplay; _behavior.Load(_testableClock); }
public void WhenGettingCalledWithDateTimeData_SetsTheTimeToTheData() { var behavior = new TimeChangeBehavior(); var clock = A.Fake <IClock>(); var expected = DateTime.Now; behavior.Load(clock, expected); behavior.Time.Should().Be(expected); }
public void WhenSetButtonPressedTwice_LoadsTimeBehavior_WithCorrectTime() { var behavior = new TimeChangeBehavior(); var clock = A.Fake <IClock>(); behavior.Time = DateTime.Now; behavior.Load(clock); behavior.OnClick(new SetClick()); behavior.OnClick(new SetClick()); A.CallTo(() => clock.SwitchBehavior <TimeBehavior>(behavior.Time)).MustHaveHappened(); }