public void Test5() { var mockData = MockDataHelper.GetInvoiceData(); InvoiceDataStore.Update(mockData.InvoiceNo, mockData); Assert.That(_invoiceStore.ContainsKey(mockData.InvoiceNo)); Assert.That(_invoiceStore[mockData.InvoiceNo].Status == Status.NotProcessed); InvoiceDataStore.UpdateStatus(mockData.InvoiceNo, Status.Digitized); Assert.That(_invoiceStore.ContainsKey(mockData.InvoiceNo)); Assert.That(_invoiceStore[mockData.InvoiceNo].Status == Status.Digitized); }
public void Test3() { var mockData = MockDataHelper.GetInvoiceData(); InvoiceDataStore.Add(mockData); Assert.That(_invoiceStore.ContainsKey(mockData.InvoiceNo)); mockData.Seller.Name = "Zomato"; mockData.ShipTo.ZipCode = "234323"; InvoiceDataStore.Update(mockData.InvoiceNo, mockData); Assert.That(_invoiceStore.ContainsKey(mockData.InvoiceNo)); Assert.That(_invoiceStore[mockData.InvoiceNo].Seller.Name.Equals("Zomato")); Assert.That(_invoiceStore[mockData.InvoiceNo].ShipTo.ZipCode.Equals("234323")); }
public void Test4() { var mockData = MockDataHelper.GetInvoiceData(); InvoiceDataStore.Add(mockData); var oldInvoiceNo = mockData.InvoiceNo; var newInvoiceNo = Guid.NewGuid().ToString(); Assert.That(_invoiceStore.ContainsKey(mockData.InvoiceNo)); mockData.InvoiceNo = newInvoiceNo; mockData.Seller.Name = "Zomato"; mockData.ShipTo.ZipCode = "234323"; InvoiceDataStore.Update(mockData.InvoiceNo, mockData); Assert.That(_invoiceStore.ContainsKey(newInvoiceNo)); Assert.That(_invoiceStore[newInvoiceNo].Seller.Name.Equals("Zomato")); Assert.That(_invoiceStore[newInvoiceNo].ShipTo.ZipCode.Equals("234323")); Assert.That(_invoiceStore.ContainsKey(oldInvoiceNo)); }
/// <summary> /// Update the invoice data /// </summary> /// <param name="invoiceNo"></param> /// <param name="invoiceData"></param> public void AddOrUpdateInvoiceData(string invoiceNo, Invoice invoiceData) { InvoiceDataStore.Update(invoiceNo, invoiceData); }