Skip to content

Instantly share code, notes, and snippets.

@explorer14
Last active August 27, 2019 18:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save explorer14/6a74ab9a38df97f6f05eceb907fd7855 to your computer and use it in GitHub Desktop.
Save explorer14/6a74ab9a38df97f6f05eceb907fd7855 to your computer and use it in GitHub Desktop.
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