public void AddVNetsThatDontExist() { List <TrackingResult> trackingIds = null; VNetParameter vNetDetails = new VNetParameter() { Region = region, VnetAddressSpaces = new List <string>() { "10.0.0.0/16" }, LocalAddressSpaces = new List <string>() { "11.0.0.0/16" }, DnsServers = new List <string>() { "11.0.0.10" }, VpnAddress = "13.0.0.1", GatewayType = GatewayType.StaticRouting }; int countOfAddedVNets = 0; NewAzureRemoteAppVNet mockCmdlet = SetUpTestCommon <NewAzureRemoteAppVNet>(); // Required parameters for this test mockCmdlet.VNetName = "vNetTest1"; mockCmdlet.Location = vNetDetails.Region; mockCmdlet.VirtualNetworkAddressSpace = vNetDetails.VnetAddressSpaces.ToArray(); mockCmdlet.LocalNetworkAddressSpace = vNetDetails.LocalAddressSpaces.ToArray(); mockCmdlet.DnsServerIpAddress = vNetDetails.DnsServers.ToArray(); mockCmdlet.VpnDeviceIpAddress = vNetDetails.VpnAddress; mockCmdlet.GatewayType = vNetDetails.GatewayType; // Setup the environment for testing this cmdlet countOfAddedVNets = MockObject.SetUpDefaultRemoteAppAddVNet(remoteAppManagementClientMock, vNetDetails); mockCmdlet.ResetPipelines(); Log("Calling Add-AzureRemoteAppVNet which should have {0} VNets", countOfAddedVNets); mockCmdlet.ExecuteCmdlet(); if (mockCmdlet.runTime().ErrorStream.Count != 0) { Assert.True(false, String.Format("Add-AzureRemoteAppVNet returned the following error {0}", mockCmdlet.runTime().ErrorStream[0].Exception.Message ) ); } trackingIds = MockObject.ConvertList <TrackingResult>(mockCmdlet.runTime().OutputPipeline); Assert.NotNull(trackingIds); Assert.True(MockObject.HasExpectedResults <TrackingResult>(trackingIds, MockObject.ContainsExpectedTrackingId), "The actual result does not match the expected." ); Log("The test for Add-AzureRemoteAppVNet completed successfully"); }