public void Test_That_ClockSetup_Returns_Correct_Date() { // Arrange // The initial date in ClockSetup should be 15th march 2011 DateTime expectedDate = new DateTime(2012, 4, 14, 0, 0, 0); ClockSetup setup = new ClockSetup(); setup.YearState = new YearState(setup, 2011); setup.MonthState = new MonthState(setup, 3); setup.DayState = new DayState(setup, 15); // Act setup.PushKnob(); setup.RotateRight(); setup.PushKnob(); setup.RotateRight(); setup.PushKnob(); setup.RotateLeft(); setup.PushKnob(); // Assert Assert.AreEqual(expectedDate, setup.GetSelectedDate); }
public YearState(ClockSetup clockSetup) { this.clockSetup = clockSetup; year = DateTime.Now.Year; }
public YearState(ClockSetup clockSetup, int y) { this.clockSetup = clockSetup; year = y; }
public DayState(ClockSetup clockSetup) { this.clockSetup = clockSetup; day = DateTime.Now.Day; }
public DayState(ClockSetup clockSetup,int p) { this.clockSetup = clockSetup; day = p; }
public MonthState(ClockSetup clockSetup) { this.clockSetup = clockSetup; month = DateTime.Now.Month; }
public DayState(ClockSetup clockSetup, int p) { this.clockSetup = clockSetup; day = p; }
public FinishedState(ClockSetup clockSetup) { this.clockSetup = clockSetup; }
public MonthState(ClockSetup clockSetup, int m) { this.clockSetup = clockSetup; month = m; }