public void GetRecordTest() { VisitorTableController target = new VisitorTableController(); Dictionary<string, object> expected = new Dictionary<string, object>(); expected.Add("ID", Convert.ToInt32(visId)); expected.Add("Name", visName); expected.Add("TimeIn", timeIn); expected.Add("TimeOut", timeOut); Dictionary<string, object> actual; actual = target.GetRecord(visId, today); Assert.IsTrue(recordCompare( expected, actual ) ); }
public VisitorTrackerForm() { _control = new VisitorTableController(); InitializeComponent(); }
public void GetRecsForReportTest() { VisitorTableController target = new VisitorTableController(); DateTime start = new DateTime( today.Year, today.Month, today.Day - 2 ); DateTime end = new DateTime(today.Year, today.Month, today.Day - 1 ); List<Dictionary<string, object>> expected = new List<Dictionary<string, object>>(); expected.Add(target.GetRecord(visId, start)); expected.Add(target.GetRecord(visId, end)); List<Dictionary<string, object>> actual; actual = target.GetRecsForReport(start, end); Assert.AreEqual(actual.Count, expected.Count); foreach (Dictionary<string, object> rec in expected) { Assert.IsTrue(recordCompare(rec, actual[expected.IndexOf(rec)])); } }
public void WriteRecordWithStudentsTest() { VisitorTableController target = new VisitorTableController(); Dictionary<string, object> record = new Dictionary<string,object>(); record.Add("ID", studId); record.Add("Name", studName); record.Add("ClassID", classId); record.Add("PIN", pin); record.Add("TimeIn", timeIn); record.Add("DroppedBy", visId); record.Add("TimeOut", timeOut); record.Add("PickedUp", visId); target.WriteRecordWithStudents(record); Assert.IsTrue(recordCompare( record, target.GetRecordWithStudents(studId, today))); }
public void WriteRecordTest() { VisitorTableController target = new VisitorTableController(); // TODO: Initialize to an appropriate value Dictionary<string, object> record = new Dictionary<string, object>(); record.Add("ID", visId); record.Add("Name", visName); record.Add("TimeIn", timeIn); record.Add("TimeOut", timeOut); target.WriteRecord(record); Assert.IsTrue( recordCompare( record, target.GetRecord(visId, today ) ) ); }
public void VisitorTableControllerConstructorTest() { VisitorTableController target = new VisitorTableController(); }
public void GetStudentVisitorsTest() { VisitorTableController target = new VisitorTableController(); Dictionary<int, string> expected = new Dictionary<int,string>(); expected.Add(visId, visName); Dictionary<int, string> actual; actual = target.GetStudentVisitors(pin); foreach (int key in expected.Keys) { Assert.AreEqual(expected[key], actual[key]); } }