public void UpdateRecieptListTest() { /* ------------------------------------------------ * NOTE * * Make sure you have the Test DB running and not the Local or the Production DB. * - Found in "BaseModel.cs" * -----------------------------------------------------*/ List <ReceiptType> OldList = _contractFull[1].ReceiptTypesOffered; OldList.Add(new ReceiptType() { RType = ReceiptType.RTypes.Text, RtypeAsString = ReceiptType.RTypes.Text.ToString() }); List <ReceiptType> NewLIst = new List <ReceiptType>() { new ReceiptType() { RType = ReceiptType.RTypes.Text, RtypeAsString = ReceiptType.RTypes.Text.ToString() }, new ReceiptType() { RType = ReceiptType.RTypes.SummaryHtml, RtypeAsString = ReceiptType.RTypes.SummaryHtml.ToString() } }; UdateReceiptList postData = new UdateReceiptList() { DistributorId = _contractFull[1].Id, ReceiptList = NewLIst }; var result = _distributorsComposer.UpdateRecieptList(_contractFull[1].Id, postData).Result.First.Last.ToString(); Assert.IsTrue(result == "success"); //remove all Receipt items from DB for clean up testing var resultClean = _distributorsComposer.UpdateRecieptList(_contractFull[1].Id, new UdateReceiptList() { DistributorId = _contractFull[1].Id, ReceiptList = new List <ReceiptType>() { } }).Result.First.Last.ToString(); Assert.IsTrue(resultClean == "success"); }
public async Task <JObject> UpdateRecieptList(string distributorId, UdateReceiptList postData) { try { return(await UpdateDistributor(postData.DistributorId, postData.ReceiptList)); } catch (Exception ex) { return (JObject.FromObject( new { status = "Exception Thrown", result = false, message = ex.Message } )); }; }
public Task <JObject> UpdateRecieptList(string distributorId, UdateReceiptList postData) { return(_distributorsServiceClient.UpdateRecieptList(distributorId, postData)); }
public async Task <JObject> UpdateRecieptList(string distributorId, UdateReceiptList postUpdate) { return(await _composer.UpdateRecieptList(distributorId, postUpdate)); }