From bbff202ca4a0ec6fd06bf44e231aa46e557189d4 Mon Sep 17 00:00:00 2001 From: dvbb <61542202+dvbb@users.noreply.github.com> Date: Mon, 2 Aug 2021 14:17:05 +0800 Subject: [PATCH] fix some unit tests 1.fix some unit tests --- .../tests/Helpers/NetworkServiceClientTestBase.cs | 6 +++--- .../tests/Tests/ExpandResourceTests.cs | 6 +++--- .../tests/Tests/PrivateEndpointTests.cs | 2 +- .../tests/Tests/RouteFilterTests.cs | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sdk/network/Azure.ResourceManager.Network/tests/Helpers/NetworkServiceClientTestBase.cs b/sdk/network/Azure.ResourceManager.Network/tests/Helpers/NetworkServiceClientTestBase.cs index 23b2ef68f98c4..f408477c27708 100644 --- a/sdk/network/Azure.ResourceManager.Network/tests/Helpers/NetworkServiceClientTestBase.cs +++ b/sdk/network/Azure.ResourceManager.Network/tests/Helpers/NetworkServiceClientTestBase.cs @@ -309,7 +309,7 @@ public async Task CreateDefaultPublicIpAddress(string name, str Operation putPublicIpAddressOperation = await publicIPAddressContainer.StartCreateOrUpdateAsync(name, publicIp); Response putPublicIpAddressResponse = await WaitForCompletionAsync(putPublicIpAddressOperation); Assert.AreEqual("Succeeded", putPublicIpAddressResponse.Value.Data.ProvisioningState.ToString()); - Response getPublicIpAddressResponse = await publicIPAddressContainer.GetAsync(resourceGroupName, name); + Response getPublicIpAddressResponse = await publicIPAddressContainer.GetAsync(name); return getPublicIpAddressResponse; } @@ -326,7 +326,7 @@ public async Task CreateNetworkInterface(string name, string r { Name = ipConfigName, PrivateIPAllocationMethod = IPAllocationMethod.Dynamic, - //Subnet = new SubnetData() { Id = subnetId } + Subnet = new SubnetData() { Id = subnetId } } } }; @@ -339,7 +339,7 @@ public async Task CreateNetworkInterface(string name, string r // Test NIC apis var networkInterfaceContainer = GetResourceGroup(resourceGroupName).GetNetworkInterfaces(); await networkInterfaceContainer.StartCreateOrUpdateAsync(name, nicParameters); - Response getNicResponse = await networkInterfaceContainer.GetAsync(resourceGroupName, name); + Response getNicResponse = await networkInterfaceContainer.GetAsync(name); Assert.AreEqual(getNicResponse.Value.Data.Name, name); // because its a single CA nic, primaryOnCA is always true diff --git a/sdk/network/Azure.ResourceManager.Network/tests/Tests/ExpandResourceTests.cs b/sdk/network/Azure.ResourceManager.Network/tests/Tests/ExpandResourceTests.cs index a2699ca2d90f0..4880322c0b74e 100644 --- a/sdk/network/Azure.ResourceManager.Network/tests/Tests/ExpandResourceTests.cs +++ b/sdk/network/Azure.ResourceManager.Network/tests/Tests/ExpandResourceTests.cs @@ -212,9 +212,9 @@ public async Task ExpandResourceTest() await WaitForCompletionAsync(createOrUpdateOperation3); // Get Nics - await networkInterfaceContainer.GetAsync(resourceGroupName, nic1name); - await networkInterfaceContainer.GetAsync(resourceGroupName, nic2name); - await networkInterfaceContainer.GetAsync(resourceGroupName, nic3name); + await networkInterfaceContainer.GetAsync(nic1name); + await networkInterfaceContainer.GetAsync(nic2name); + await networkInterfaceContainer.GetAsync(nic3name); // Get lb with expanded nics from nat rules getLoadBalancer = await loadBalancerContainer.GetAsync(lbName, "InboundNatRules/backendIPConfiguration"); diff --git a/sdk/network/Azure.ResourceManager.Network/tests/Tests/PrivateEndpointTests.cs b/sdk/network/Azure.ResourceManager.Network/tests/Tests/PrivateEndpointTests.cs index 985fa014ee840..b5f79154e5912 100644 --- a/sdk/network/Azure.ResourceManager.Network/tests/Tests/PrivateEndpointTests.cs +++ b/sdk/network/Azure.ResourceManager.Network/tests/Tests/PrivateEndpointTests.cs @@ -228,7 +228,7 @@ public async Task AvailablePrivateEndpointTypeTest() public async Task AvailablePrivateEndpointInResourceGroupTypeTest() { var resourceGroup = (await createResourceGroup()).Value; - var types = await ArmClient.DefaultSubscription.GetAvailablePrivateEndpointTypesByResourceGroupAsync(TestEnvironment.Location, resourceGroup.Data.Name).ToEnumerableAsync(); + var types = await ArmClient.DefaultSubscription.GetAvailablePrivateEndpointTypesByResourceGroupAsync( resourceGroup.Data.Name, TestEnvironment.Location).ToEnumerableAsync(); Assert.IsNotEmpty(types); } } diff --git a/sdk/network/Azure.ResourceManager.Network/tests/Tests/RouteFilterTests.cs b/sdk/network/Azure.ResourceManager.Network/tests/Tests/RouteFilterTests.cs index fd88b5e46caf8..d86bba5c8a1c4 100644 --- a/sdk/network/Azure.ResourceManager.Network/tests/Tests/RouteFilterTests.cs +++ b/sdk/network/Azure.ResourceManager.Network/tests/Tests/RouteFilterTests.cs @@ -36,7 +36,7 @@ public async Task CleanupResourceGroup() await CleanupResourceGroupsAsync(); } - private const string Filter_Commmunity = "12076:51004"; + private const string Filter_Commmunity = "12076:51006"; [Test] public async Task RouteFilterApiTest()