Skip to content

Instantly share code, notes, and snippets.

@explorer14
Last active August 27, 2019 18:24
  • 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?
public void RegisterServices()
{
// while running the service locally, mock external call
// so it always succeeds (as long as it
// itself is not the subject of the test)
var isDevelopmentEnvironment = DetermineCurrentEnvironment();
if (isDevelopmentEnvironment)
webserviceContainer.Register<ICancelPurchaseOrderLine,
AlwaysCancelPurchaseOrderLineSuccessfully>();
else // otherwise use the actual live web service adapter
webserviceContainer.Register<ICancelPurchaseOrderLine,
RealPurchaseOrderService>();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment