Example #1
0
 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);
 }
Example #2
0
 public YearState(ClockSetup clockSetup)
 {
     this.clockSetup = clockSetup;
     year = DateTime.Now.Year;
 }
Example #3
0
 public YearState(ClockSetup clockSetup, int y)
 {
     this.clockSetup = clockSetup;
     year =  y;
 }
Example #4
0
 public DayState(ClockSetup clockSetup)
 {
     this.clockSetup = clockSetup;
     day = DateTime.Now.Day;
 }
Example #5
0
 public DayState(ClockSetup clockSetup,int p)
 {
     this.clockSetup = clockSetup;
     day =  p;
 }
Example #6
0
 public DayState(ClockSetup clockSetup)
 {
     this.clockSetup = clockSetup;
     day             = DateTime.Now.Day;
 }
Example #7
0
 public MonthState(ClockSetup clockSetup)
 {
     this.clockSetup = clockSetup;
     month = DateTime.Now.Month;
 }
Example #8
0
 public DayState(ClockSetup clockSetup, int p)
 {
     this.clockSetup = clockSetup;
     day             = p;
 }
Example #9
0
 public FinishedState(ClockSetup clockSetup)
 {
     this.clockSetup = clockSetup;
 }
Example #10
0
 public MonthState(ClockSetup clockSetup, int m)
 {
     this.clockSetup = clockSetup;
     month = m;
 }
Example #11
0
 public FinishedState(ClockSetup clockSetup)
 {
     this.clockSetup = clockSetup;
 }
Example #12
0
 public MonthState(ClockSetup clockSetup)
 {
     this.clockSetup = clockSetup;
     month           = DateTime.Now.Month;
 }
Example #13
0
 public MonthState(ClockSetup clockSetup, int m)
 {
     this.clockSetup = clockSetup;
     month           = m;
 }
Example #14
0
 public YearState(ClockSetup clockSetup)
 {
     this.clockSetup = clockSetup;
     year            = DateTime.Now.Year;
 }
Example #15
0
 public YearState(ClockSetup clockSetup, int y)
 {
     this.clockSetup = clockSetup;
     year            = y;
 }