-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #35 from SeanFeldman/develop
release-2.2.0
- Loading branch information
Showing
14 changed files
with
161 additions
and
31 deletions.
There are no files selected for viewing
This file contains 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
27 changes: 26 additions & 1 deletion
27
src/ServiceBus.AttachmentPlugin.Tests/AzureStorageEmulatorFixture.cs
This file contains 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 |
---|---|---|
@@ -1,15 +1,40 @@ | ||
namespace ServiceBus.AttachmentPlugin.Tests | ||
{ | ||
using System; | ||
using System.Diagnostics; | ||
using System.Linq; | ||
using System.Net; | ||
using System.Net.NetworkInformation; | ||
using System.Threading; | ||
|
||
public class AzureStorageEmulatorFixture | ||
{ | ||
public static IProvideStorageConnectionString ConnectionStringProvider = new PlainTextConnectionStringProvider("UseDevelopmentStorage=true"); | ||
|
||
public AzureStorageEmulatorFixture() | ||
{ | ||
AzureStorageEmulatorManager.StartStorageEmulator(); | ||
|
||
// Emulator is not started fast enough on AppVeyor | ||
// Microsoft.WindowsAzure.Storage.StorageException : Unable to connect to the remote server | ||
Thread.Sleep(1000); | ||
|
||
var properties = IPGlobalProperties.GetIPGlobalProperties(); | ||
bool emulatorStarted; | ||
|
||
var stopwatch = Stopwatch.StartNew(); | ||
|
||
do | ||
{ | ||
var endpoints = properties.GetActiveTcpListeners(); | ||
emulatorStarted = endpoints.Any(x => x.Port == 10000 && Equals(x.Address, IPAddress.Loopback)); | ||
Console.WriteLine("waiting for emulator to start..."); | ||
Thread.Sleep(100); | ||
} while (emulatorStarted == false && stopwatch.Elapsed < TimeSpan.FromSeconds(60)); | ||
|
||
if (emulatorStarted == false) | ||
{ | ||
throw new Exception("Storage emulator failed to start after 10 seconds."); | ||
} | ||
} | ||
} | ||
} |
This file contains 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 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 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 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 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 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 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
15 changes: 15 additions & 0 deletions
15
src/ServiceBus.AttachmentPlugin/IProvideStorageConnectionString.cs
This file contains 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,15 @@ | ||
namespace ServiceBus.AttachmentPlugin | ||
{ | ||
using System.Threading.Tasks; | ||
|
||
/// <summary> | ||
/// Storage account connection string provider. | ||
/// </summary> | ||
public interface IProvideStorageConnectionString | ||
{ | ||
/// <summary> | ||
/// Connection string for storage account to be used. | ||
/// </summary> | ||
Task<string> GetConnectionString(); | ||
} | ||
} |
Oops, something went wrong.