I am building an application that leverages Microsoft Azure and I am using Microsoft Azure .NET API calls for managing my infrastructure. I want to move to the testing phase, and I am curious if there are ways to force the calls to fail other providing bogus parameters.
For instance, I have the following snippet of code which powers on a VM. Is there a way to get this call to automatically fail when given correct parameters?
using (ComputeManagementClient client = new ComputeManagementClient(new CertificateCloudCredentials(c_subscriptionId, MyCert)))
{
var status = client.VirtualMachines.Start(serviceName, deploymentName, vmName);
if (status.Status == OperationStatus.Failed)
{
throw new MachineCreationException(status.Error.Code, null);
}
}
Thanks in advance!