public void Insert_TrafficRequestEmptyPrecardTest() { try { busTrafficRequest = new BRequest(ADOPerson2.ID); request_testObject.TheFromDate = Utility.ToString(new DateTime(2010, 5, 12)); request_testObject.TheToDate = Utility.ToString(new DateTime(2010, 5, 12)); request_testObject.TheFromTime = "08:00"; request_testObject.TheToTime = "10:00"; request_testObject.Precard = new Precard() { ID = -1 }; busTrafficRequest.InsertRequest(request_testObject); ClearSession(); request_testObject = new BRequest().GetByID(request_testObject.ID); Assert.AreEqual("0", request_testObject.Precard.Code); Assert.IsTrue(request_testObject.User.ID > 0); busTrafficRequest.DeleteRequest(request_testObject); } catch (Exception ex) { Assert.Fail(ex.Message); } }
public void Insert_TrafficRequestEmptyFromTimeTest() { try { busTrafficRequest = new BRequest(ADOPerson2.ID); request_testObject.TheFromDate = Utility.ToString(new DateTime(2010, 5, 12)); request_testObject.TheToDate = Utility.ToString(new DateTime(2010, 5, 12)); request_testObject.TheFromTime = ""; request_testObject.TheToTime = "17:00"; request_testObject.Precard = new Precard() { ID = ADOPrecardTraffic1.ID }; busTrafficRequest.InsertRequest(request_testObject); ClearSession(); request_testObject = new BRequest().GetByID(request_testObject.ID); Assert.AreEqual(-1000, request_testObject.FromTime); busTrafficRequest.DeleteRequest(request_testObject); } catch (Exception ex) { Assert.Fail(ex.Message); } }