public void GetBatchLocationQuotasTest() { List<PSBatchLocationQuotas> pipelineOutput = new List<PSBatchLocationQuotas>(); // Return a pre-built object when the command is issued. string location = "westus"; PSBatchLocationQuotas quotas = new PSBatchLocationQuotas(location, new BatchLocationQuota(accountQuota: 5)); batchClientMock.Setup(b => b.GetLocationQuotas(location)).Returns(quotas); cmdlet.Location = location; cmdlet.ExecuteCmdlet(); // Verify the returned object was written to the pipeline. commandRuntimeMock.Verify(r => r.WriteObject(quotas), Times.Once()); }
public void GetBatchLocationQuotasTest() { List <PSBatchLocationQuotas> pipelineOutput = new List <PSBatchLocationQuotas>(); // Return a pre-built object when the command is issued. string location = "westus"; PSBatchLocationQuotas quotas = new PSBatchLocationQuotas(location, new BatchLocationQuota(accountQuota: 5)); batchClientMock.Setup(b => b.GetLocationQuotas(location)).Returns(quotas); cmdlet.Location = location; cmdlet.ExecuteCmdlet(); // Verify the returned object was written to the pipeline. commandRuntimeMock.Verify(r => r.WriteObject(quotas), Times.Once()); }
public override void ExecuteCmdlet() { PSBatchLocationQuotas quotas = BatchClient.GetLocationQuotas(this.Location); WriteObject(quotas); }