Example #1
0
        public static int SetUpDefaultVpnDevice(Mock <IRemoteAppManagementClient> clientMock, string name)
        {
            ISetup <IRemoteAppManagementClient, Task <VNetVpnDeviceResult> > setup = null;

            VNetVpnDeviceResult response = new VNetVpnDeviceResult()
            {
                RequestId  = "23411-345",
                StatusCode = System.Net.HttpStatusCode.OK,
                Vendors    = new Vendor[]
                {
                    new Vendor()
                    {
                        Name      = "Acme",
                        Platforms = new List <Platform>()
                        {
                            new Platform()
                            {
                                Name       = "BasicVPN",
                                OsFamilies = new List <OsFamily>()
                            }
                        }
                    }
                }
            };

            mockVpnList = new List <Vendor>(response.Vendors);

            setup = clientMock.Setup(c => c.VNet.GetVpnDevicesAsync(name, It.IsAny <CancellationToken>()));
            setup.Returns(Task.Factory.StartNew(() => response));

            return(mockVpnList.Count);
        }
Example #2
0
        public void CanGetVpnDevices()
        {
            using (UndoContext context = UndoContext.Current)
            {
                context.Start();
                HttpRecorderMode          mode = HttpMockServer.GetCurrentMode();
                RemoteAppManagementClient remoteAppManagementClient = GetRemoteAppManagementClient();

                Assert.DoesNotThrow(() =>
                {
                    string vNet = TestVnet;
                    VNetVpnDeviceResult result = remoteAppManagementClient.VNet.GetVpnDevices(vNet);

                    Assert.NotNull(result);
                    Assert.Equal(HttpStatusCode.OK, result.StatusCode);
                    ValidateVendors(result.Vendors);
                });
            }
        }
Example #3
0
        public override void ExecuteCmdlet()
        {
            VNetVpnDeviceResult response = CallClient(() => Client.VNet.GetVpnDevices(VNetName), Client.VNet);

            WriteObject(response.Vendors, true);
        }