Inheritance: Microsoft.WindowsAzure.Commands.ServiceManagement.Model.ServiceOperationContext, IPersistentVM
        public GetAzureNetworkInterfaceConfigCmdletInfo(string name, PersistentVMRoleContext vm)
        {
            this.cmdletName = Utilities.GetAzureNetworkInterfaceConfig;

            if (!string.IsNullOrEmpty(name))
            {
                this.parameters.Add(new CmdletParam("Name", name));
            }

            this.parameters.Add(new CmdletParam("VM", vm));
        }
        public void GetIPForwardingOnVMNicSucceeds()
        {
            // Setup
            var VM = new PersistentVMRoleContext()
            {
                // these are the only 2 properties being used in the cmdlet
                Name = RoleName,
                DeploymentName = DeploymentName
            };

            cmdlet = new GetAzureIPForwarding
            {
                ServiceName = ServiceName,
                VM = VM,
                NetworkInterfaceName = NetworkInterfaceName,
                CommandRuntime = mockCommandRuntime,
                Client = this.client,
            };
            cmdlet.SetParameterSet(GetAzureIPForwarding.IaaSIPForwardingParamSet);

            // Action
            cmdlet.ExecuteCmdlet();

            // Assert
            computeClientMock.Verify(
                c => c.Deployments.GetBySlotAsync(
                    ServiceName,
                    DeploymentSlot.Production,
                    It.IsAny<CancellationToken>()),
                Times.Never());

            networkingClientMock.Verify(
                c => c.IPForwarding.GetForNetworkInterfaceAsync(
                    cmdlet.ServiceName,
                    DeploymentName,
                    VM.Name,
                    cmdlet.NetworkInterfaceName,
                    It.IsAny<CancellationToken>()),
                Times.Once());

            Assert.Equal(1, mockCommandRuntime.OutputPipeline.Count);
            Assert.Equal("Disabled", mockCommandRuntime.OutputPipeline[0]);
        }
 public GetAzureEndpointCmdletInfo(PersistentVMRoleContext vmRoleCtxt)
 {
     this.cmdletName = Utilities.GetAzureEndpointCmdletName;
     this.cmdletParams.Add(new CmdletParam("VM", vmRoleCtxt));
 }
        private IPersistentVM GetAzureVM(String roleName, String serviceName)
        {
            var vm = new PersistentVM {RoleName = roleName};
            var vmContext = new PersistentVMRoleContext
            {
                DeploymentName = roleName,
                Name = roleName,
                ServiceName = serviceName,
                VM = vm
            };

            return vmContext;
        }
 public RemoveAzureEndpointCmdletInfo(string epName, PersistentVMRoleContext vmRoleCtxt)
 {
     this.cmdletName = Utilities.RemoveAzureEndpointCmdletName;
     this.cmdletParams.Add(new CmdletParam("Name", epName));
     this.cmdletParams.Add(new CmdletParam("VM", vmRoleCtxt));
 }