This repository was archived by the owner on Oct 12, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
Add GetQueue specification #6
Open
ghost
wants to merge
3
commits into
master
Choose a base branch
from
daschult/swagger
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -51,9 +51,12 @@ packages | |
| *.user | ||
| .ntvs_analysis.dat | ||
| obj/* | ||
| .env | ||
| *.env | ||
| typings/ | ||
| dist/ | ||
| out/ | ||
| output/ | ||
| typedoc | ||
| typedoc | ||
| bin/ | ||
| obj/ | ||
| .vs/ | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| | ||
This conversation was marked as resolved.
Show resolved
Hide resolved
|
||
| Microsoft Visual Studio Solution File, Format Version 12.00 | ||
| # Visual Studio 15 | ||
| VisualStudioVersion = 15.0.28010.2041 | ||
| MinimumVisualStudioVersion = 10.0.40219.1 | ||
| Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ServiceBusDotNetTests", "ServiceBusDotNetTests\ServiceBusDotNetTests.csproj", "{6582A711-A992-456D-A47D-3D51139D3615}" | ||
| EndProject | ||
| Global | ||
| GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
| Debug|Any CPU = Debug|Any CPU | ||
| Release|Any CPU = Release|Any CPU | ||
| EndGlobalSection | ||
| GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
| {6582A711-A992-456D-A47D-3D51139D3615}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| {6582A711-A992-456D-A47D-3D51139D3615}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| {6582A711-A992-456D-A47D-3D51139D3615}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| {6582A711-A992-456D-A47D-3D51139D3615}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| EndGlobalSection | ||
| GlobalSection(SolutionProperties) = preSolution | ||
| HideSolutionNode = FALSE | ||
| EndGlobalSection | ||
| GlobalSection(ExtensibilityGlobals) = postSolution | ||
| SolutionGuid = {FD5B3B3B-DF5D-48AA-8C5F-402CAE02D25D} | ||
| EndGlobalSection | ||
| EndGlobal | ||
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,64 @@ | ||
| using Microsoft.Azure.ServiceBus; | ||
| using Microsoft.Azure.ServiceBus.Management; | ||
| using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
| using System.IO; | ||
| using System.Threading.Tasks; | ||
|
|
||
| namespace ServiceBusDotNetTests | ||
| { | ||
| [TestClass] | ||
| public class QueueTests | ||
| { | ||
| private const string queuePath = "testQueuePath"; | ||
|
|
||
| private static string connectionString = null; | ||
|
|
||
| private static ManagementClient CreateManagementClient() | ||
| { | ||
| if (connectionString == null) | ||
| { | ||
| string sbauthEnvFilePath = Path.GetFullPath("sbauth.env"); | ||
| Assert.IsTrue(File.Exists(sbauthEnvFilePath), $"The file {sbauthEnvFilePath} doesn't exist."); | ||
|
|
||
| connectionString = File.ReadAllText(sbauthEnvFilePath); | ||
| Assert.IsNotNull(connectionString, $"The contents of {sbauthEnvFilePath} cannot be null."); | ||
| Assert.AreNotEqual("", connectionString, $"The contents of {sbauthEnvFilePath} cannot be empty."); | ||
| } | ||
| return new ManagementClient(connectionString); | ||
| } | ||
|
|
||
| [TestMethod] | ||
| [Ignore] | ||
| public async Task CreateQueueAsync() | ||
| { | ||
| ManagementClient managementClient = CreateManagementClient(); | ||
| QueueDescription queueDescription = await managementClient.CreateQueueAsync(new QueueDescription(queuePath)); | ||
| Assert.IsNotNull(queueDescription); | ||
| Assert.AreEqual(queuePath, queueDescription.Path); | ||
| } | ||
|
|
||
| [TestMethod] | ||
| public async Task GetExistingQueueAsync() | ||
| { | ||
| ManagementClient managementClient = CreateManagementClient(); | ||
| QueueDescription queueDescription = await managementClient.GetQueueAsync(queuePath); | ||
| Assert.IsNotNull(queueDescription); | ||
| Assert.AreEqual(queuePath, queueDescription.Path); | ||
| } | ||
|
|
||
| [TestMethod] | ||
| public async Task GetNonExistingQueueAsync() | ||
| { | ||
| ManagementClient managementClient = CreateManagementClient(); | ||
| await Assert.ThrowsExceptionAsync<MessagingEntityNotFoundException>(() => managementClient.GetQueueAsync(queuePath + "NonExisting")); | ||
| } | ||
|
|
||
| [TestMethod] | ||
| [Ignore] | ||
| public async Task DeleteQueueAsync() | ||
| { | ||
| ManagementClient managementClient = CreateManagementClient(); | ||
| await managementClient.DeleteQueueAsync(queuePath); | ||
| } | ||
| } | ||
| } |
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,22 @@ | ||
| <Project Sdk="Microsoft.NET.Sdk"> | ||
|
|
||
| <PropertyGroup> | ||
| <TargetFramework>netcoreapp2.1</TargetFramework> | ||
|
|
||
| <IsPackable>false</IsPackable> | ||
| </PropertyGroup> | ||
|
|
||
| <ItemGroup> | ||
| <PackageReference Include="Microsoft.Azure.ServiceBus" Version="3.1.1" /> | ||
| <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.8.0" /> | ||
| <PackageReference Include="MSTest.TestAdapter" Version="1.3.2" /> | ||
| <PackageReference Include="MSTest.TestFramework" Version="1.3.2" /> | ||
| </ItemGroup> | ||
|
|
||
| <ItemGroup> | ||
| <None Update="sbauth.env"> | ||
| <CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
| </None> | ||
| </ItemGroup> | ||
|
|
||
| </Project> |
Oops, something went wrong.
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.