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();
        }
        public void WhenIncreasingMinutesToMaxValue_DoesNot_IncreaseHours()
        {
            var behavior = new TimeChangeBehavior
            {
                Time = new DateTime(2015, 3, 27, 12, 59, 0)
            };

            behavior.IncrementMinute();
            behavior.Time.Hour.Should().Be(12);
            behavior.Time.Minute.Should().Be(0);
        }