Skip to content

Instantly share code, notes, and snippets.

@kulvirTAC
Created May 15, 2023 20:40
Show Gist options
  • Save kulvirTAC/b5b9b5a11a46930f5a158e24245870f8 to your computer and use it in GitHub Desktop.
Save kulvirTAC/b5b9b5a11a46930f5a158e24245870f8 to your computer and use it in GitHub Desktop.
Order Missing Inventory Test
/// <summary>
/// Test error when inventory is missing from Acumatica
/// when adding order
/// </summary>
[Fact]
public void OrderMissingInventoryTest()
{
try
{
string createdOrder = service.AddOrder(Properties.Resources.OrderMissingInventory);
// Should error out and not reach the next line of code
dynamic acumaticaOrder = JsonConvert.DeserializeObject(createdOrder);
}
catch (HttpRequestException exc)
{
output.WriteLine(exc.Message);
Assert.Contains("InventoryID", exc.Message);
}
catch (Exception exc)
{
Assert.False(true, exc.Message);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment