SnapDevelop and xUnit
- How-to
- Thomas Rolseth
- SnapObjects
- Friday, 2 August 2019 09:33 PM UTC
Has anyone created unit tests for a service in SnapDevelop using xUnit? I have a simple test shown below which builds fine. When I run the test I get the attached error. Would love to see a working example from someone. Given that the service method is returning a datastore I'm not sure how to use Assert in this instance.
Thanks, Tom
private readonly IOrderService _orderService;
public OrderServiceTests(IOrderService OrderService)
{
_orderService = OrderService;
}
[Fact]
public void Test_Orders()
{
var int id = 1;
// Invoke the service method
var result = _orderService.GetOrder(id);
// Validate the result
Assert.Empty(result);
}
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.