Beispiel #1
0
 public void testDescription()
 {
     TimeEntry target = new TimeEntry();
     string expected = "This is a Simple Testing String";
     string actual;
     target.description = expected;
     actual = target.description;
     Assert.AreEqual(expected, actual);
 }
Beispiel #2
0
 public void testDay()
 {
     TimeEntry target = new TimeEntry();
     DateTime expected = new DateTime();
     DateTime actual;
     target.day = expected;
     actual = target.day;
     Assert.AreEqual(expected, actual);
 }
Beispiel #3
0
        public void testAcceptableHours()
        {
            TimeEntry target = new TimeEntry();

            target.hours = -0.25;
            Assert.AreEqual(target.hours, 0);

            target.hours = 24.25;
            Assert.AreEqual(target.hours, 0);
        }
Beispiel #4
0
 private TimeEntry processEntry(string[] fields)
 {
     TimeEntry entry = new TimeEntry();
     entry.jobId = fields[0].Trim('"');
     entry.description = fields[1].Trim('"');
     entry.day = Convert.ToDateTime(fields[2].Trim('"'));
     int fieldLength = fields.Length;
     entry.hours = Convert.ToDouble(fields[fieldLength-1].Trim('"'));
     return entry;
 }
Beispiel #5
0
 public void testHours()
 {
     TimeEntry target = new TimeEntry();
     double expected = 0.0;
     double actual;
     target.hours = expected;
     actual = target.hours;
     Assert.AreEqual(expected, actual);
 }
Beispiel #6
0
 public void TimeEntryConstructorTest()
 {
     TimeEntry target = new TimeEntry();
     Assert.AreEqual(target.description, String.Empty);
     Assert.AreEqual(target.jobId, String.Empty);
     Assert.AreEqual(target.hours, 0.0);
     Assert.AreEqual(target.day.Date, DateTime.Today);
 }
Beispiel #7
0
 public void testJobId()
 {
     TimeEntry target = new TimeEntry();
     string expected = "T14001";
     string actual;
     target.jobId = expected;
     actual = target.jobId;
     Assert.AreEqual(expected, actual);
 }