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