-
Notifications
You must be signed in to change notification settings - Fork 5.1k
AVS 2023-09-01 SDK Tests #46831
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
archerzz
merged 10 commits into
Azure:main
from
anaarias-msft:anaarias/avs_2023-09-01-dotnet-sdk-tests
Oct 31, 2024
Merged
AVS 2023-09-01 SDK Tests #46831
Changes from 9 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
56b7b1b
add mock test autorest file
anaarias-msft 179eb35
Merge branch 'main' of https://github.com/anaarias-msft/azure-sdk-for…
anaarias-msft cfcbcab
fix added test
anaarias-msft e47f1c5
Merge branch 'main' of https://github.com/anaarias-msft/azure-sdk-for…
anaarias-msft 2778780
Merge branch 'main' of https://github.com/anaarias-msft/azure-sdk-for…
anaarias-msft 88a0615
Merge branch 'main' of https://github.com/anaarias-msft/azure-sdk-for…
anaarias-msft f7bd81e
Merge branch 'main' of https://github.com/anaarias-msft/azure-sdk-for…
anaarias-msft 38a775c
tests and assets changes
anaarias-msft baaae70
add new delete test recordings
anaarias-msft 64d6d86
added test recording
anaarias-msft File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
sdk/avs/Azure.ResourceManager.Avs/tests/Scenario/IscsiPathResourceTest.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT License. | ||
|
|
||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Linq; | ||
| using System.Text; | ||
| using System.Threading.Tasks; | ||
| using Azure.Core; | ||
| using Azure.Core.TestFramework; | ||
| using Azure.ResourceManager.Avs.Models; | ||
| using NUnit.Framework; | ||
|
|
||
| namespace Azure.ResourceManager.Avs.Tests.Scenario | ||
| { | ||
| public class IscsiPathResourceTest : AvsManagementTestBase | ||
| { | ||
| public IscsiPathResourceTest(bool isAsync) : base(isAsync) | ||
| { | ||
| } | ||
|
|
||
| [TestCase, Order(1)] | ||
| [RecordedTest] | ||
| public async Task Create() | ||
| { | ||
| IscsiPathData data = new IscsiPathData() | ||
| { | ||
| NetworkBlock = "172.16.0.0/24", | ||
| }; | ||
| ArmOperation<IscsiPathResource> lro = await getIscsiPathResource().CreateOrUpdateAsync(WaitUntil.Completed, data); | ||
| IscsiPathResource result = lro.Value; | ||
| Assert.AreEqual(result.Data.Name, ISCSI_PATH_NAME); | ||
| } | ||
|
|
||
| [TestCase, Order(2)] | ||
| [RecordedTest] | ||
| public async Task Get() | ||
| { | ||
| IscsiPathResource iscsiPath = await getIscsiPathResource().GetAsync(); | ||
| Assert.AreEqual(iscsiPath.Data.Name, ISCSI_PATH_NAME); | ||
| } | ||
|
|
||
| [TestCase, Order(3)] | ||
| [RecordedTest] | ||
| public async Task Delete() | ||
| { | ||
| ArmOperation lro = await getIscsiPathResource().DeleteAsync(WaitUntil.Started); | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
80 changes: 80 additions & 0 deletions
80
sdk/avs/Azure.ResourceManager.Avs/tests/Scenario/WorkloadNetworkVmGroupCollectionTest.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT License. | ||
|
|
||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Linq; | ||
| using System.Text; | ||
| using System.Threading.Tasks; | ||
| using Azure.Core; | ||
| using Azure.Core.TestFramework; | ||
| using Azure.ResourceManager.Avs.Models; | ||
| using NUnit.Framework; | ||
|
|
||
| namespace Azure.ResourceManager.Avs.Tests.Scenario | ||
| { | ||
| public class WorkloadNetworkVmGroupCollectionTest: AvsManagementTestBase | ||
| { | ||
| public WorkloadNetworkVmGroupCollectionTest(bool isAsync) : base(isAsync) | ||
| { | ||
| } | ||
|
|
||
| [TestCase, Order(1)] | ||
| [RecordedTest] | ||
| public async Task GetCollection() | ||
| { | ||
| WorkloadNetworkVmGroupCollection collection = getWorkloadNetworkResource().GetWorkloadNetworkVmGroups(); | ||
| var workloadNetworksList = new List<WorkloadNetworkVmGroupResource>(); | ||
| await foreach (WorkloadNetworkVmGroupResource item in collection.GetAllAsync()) | ||
| { | ||
| workloadNetworksList.Add(item); | ||
| } | ||
|
|
||
| Assert.IsTrue(workloadNetworksList.Any()); | ||
| } | ||
|
|
||
| [TestCase, Order(1)] | ||
| [RecordedTest] | ||
| public async Task GetCollectionOld() | ||
| { | ||
| WorkloadNetworkVmGroupCollection collection = getWorkloadNetworkResourceOld().GetWorkloadNetworkVmGroups(); | ||
| var workloadNetworksList = new List<WorkloadNetworkVmGroupResource>(); | ||
| await foreach (WorkloadNetworkVmGroupResource item in collection.GetAllAsync()) | ||
| { | ||
| workloadNetworksList.Add(item); | ||
| } | ||
|
|
||
| Assert.IsTrue(workloadNetworksList.Any()); | ||
| } | ||
|
|
||
| [TestCase, Order(2)] | ||
| [RecordedTest] | ||
| public async Task GetResource() | ||
| { | ||
| WorkloadNetworkVmGroupCollection collection = getWorkloadNetworkResource().GetWorkloadNetworkVmGroups(); | ||
| WorkloadNetworkVmGroupResource result = await collection.GetAsync(WORKLOAD_NETWORK_NAME); | ||
| Assert.AreEqual(result.Data.Name, WORKLOAD_NETWORK_NAME); | ||
| } | ||
|
|
||
| [TestCase, Order(3)] | ||
| [RecordedTest] | ||
| public async Task resourceExisits() | ||
| { | ||
| WorkloadNetworkVmGroupCollection collection = getWorkloadNetworkResource().GetWorkloadNetworkVmGroups(); | ||
| bool result = await collection.ExistsAsync(WORKLOAD_NETWORK_NAME); | ||
| Assert.True(result); | ||
| result = await collection.ExistsAsync("wn1"); | ||
| Assert.False(result); | ||
| } | ||
| [TestCase, Order(4)] | ||
| [RecordedTest] | ||
| public async Task getIfExisits() | ||
| { | ||
| WorkloadNetworkVmGroupCollection collection = getWorkloadNetworkResource().GetWorkloadNetworkVmGroups(); | ||
| NullableResponse<WorkloadNetworkVmGroupResource> response = await collection.GetIfExistsAsync(WORKLOAD_NETWORK_NAME); | ||
| WorkloadNetworkVmGroupResource result = response.HasValue ? response.Value : null; | ||
| Assert.NotNull(result); | ||
| Assert.AreEqual(result.Data.Name, WORKLOAD_NETWORK_NAME); | ||
| } | ||
| } | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.