Skip to content

Instantly share code, notes, and snippets.

@kulvirTAC
Created May 15, 2023 20:40
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
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