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