public virtual async Task<IHttpActionResult> UpsertCarHireData(CarHireDataContract data)
 {
     data.UserName = User.Identity.Name;
     var service = Bootstrapper.Container.Resolve<ICarHireService>();
     var result = await Task.Run(() => service.UpsertDataEntry(data));
     return Ok(result);
 }
 public void CostCentreSpaceMustBeValidCostCode()
 {
     //Arrange
     var sut = new AvisCourierHandler("test");
     var contract = new CarHireDataContract();
     var values = new Dictionary<string, object> { { "COST CENTRE", "123.456" } };
     //Act
     var result = sut.Convert(contract, values);
     //Assert
     Assert.AreEqual("000000123", result.CostCode);
 }
 public void TotalKmsSpaceMustBeValidUnits()
 {
     //Arrange
     var sut = new AvisCourierHandler("test");
     var contract = new CarHireDataContract();
     var values = new Dictionary<string, object> { { "TOTAL KMS", 1234.12345 } };
     //Act
     var result = sut.Convert(contract, values);
     //Assert
     Assert.AreEqual(1234.12345M, result.Units);
 }
 public void CheckoutdateSpaceMustBeValidStartDate()
 {
     //Arrange
     var sut = new AvisCourierHandler("test");
     var contract = new CarHireDataContract();
     var values = new Dictionary<string, object> { { "CHECK OUT DATE", "2013-05-13" } };
     //Act
     var result = sut.Convert(contract, values);
     //Assert
     Assert.AreEqual(new DateTime(2013, 5, 13), result.StartDate);
 }
 public void CargroupbillSpaceMustBeValidCarGroupBill()
 {
     //Arrange
     var sut = new AvisCourierHandler("test");
     var contract = new CarHireDataContract();
     var values = new Dictionary<string, object> { { "CAR GROUP BILL", "D" } };
     //Act
     var result = sut.Convert(contract, values);
     //Assert
     Assert.AreEqual(CarGroupBill.D, result.CarGroupBill);
 }
 public void TotalchargeDashMustBeValidMoney()
 {
     //Arrange
     var sut = new AvisCourierHandler("test");
     var contract = new CarHireDataContract();
     var values = new Dictionary<string, object> {{"TOTAL-CHARGE", 1234.12345}};
     //Act
     var result = sut.Convert(contract, values);
     //Assert
     Assert.AreEqual(1234.12345M, result.Money);
 }