Example #1
0
        public void ShouldGiveTicket()
        {
            var sut = new RidingDay();
            sut.IssueTicket(new DateTime(2000, 1, 1, 13, 0, 0));

            Assert.AreEqual(2,sut.TicketNumber);
            Assert.AreEqual(1, sut.PendingTickets.Count);
        }
Example #2
0
        public void ShouldSetupRidingDayWithCorrectDefaults()
        {
            var sut = new RidingDay();

            Assert.AreEqual(TimeSpan.FromHours(12), sut.Start);
            Assert.AreEqual(TimeSpan.FromHours(20),sut.End);
            Assert.AreEqual(1,sut.WindowSize);
            Assert.AreEqual(5,sut.MaxRiders);
        }
Example #3
0
 /// <summary>
 /// create a new day and pass the values from the 
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void button1_Click(object sender, EventArgs e)
 {
     //inserted validation to insure that times cannot come before the start.
     if (dtpEndTime.Value.TimeOfDay < dtpStartTime.Value.TimeOfDay)
     {
         MessageBox.Show("The endtime should not come before the Start Time.  Please adjust.", "Time Error");
     }
     else
     {
         var day = new RidingDay
         (
             (int)dtpStartTime.Value.TimeOfDay.TotalHours,
             (int)dtpEndTime.Value.TimeOfDay.TotalHours,
             (int)numMinutes.Value,
             (int)numRidersPer.Value,
             (int)numFirstTickets.Value
         );
     Main.Today = day;
     Main.Show();
     Close();
     }
 }
Example #4
0
 public frmMain()
 {
     Today = new RidingDay();
     InitializeComponent();
 }