Skip to content

Commit

Permalink
Fix EdgeHub CI Tests (#276)
Browse files Browse the repository at this point in the history
  • Loading branch information
varunpuranik authored Sep 12, 2018
1 parent edb15fb commit 4f3ccd6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ public class CloudConnectionProviderTest
[Integration]
public async Task ConnectTest()
{
var edgeHub = Mock.Of<IEdgeHub>();
ICloudConnectionProvider cloudConnectionProvider = new CloudConnectionProvider(MessageConverterProvider, ConnectionPoolSize, new ClientProvider(), Option.None<UpstreamProtocol>(), TokenProvider, DeviceScopeIdentitiesCache, TimeSpan.FromMinutes(60));
cloudConnectionProvider.BindEdgeHub(edgeHub);
string deviceConnectionString = await SecretsHelper.GetSecretFromConfigKey("device1ConnStrKey");
var deviceIdentity = Mock.Of<IDeviceIdentity>(m => m.Id == ConnectionStringHelper.GetDeviceId(deviceConnectionString));
var clientCredentials = new SharedKeyCredentials(deviceIdentity, deviceConnectionString, null);
Expand All @@ -41,8 +43,9 @@ public async Task ConnectTest()
[Integration]
public async Task ConnectWithInvalidConnectionStringTest()
{
var edgeHub = Mock.Of<IEdgeHub>();
ICloudConnectionProvider cloudConnectionProvider = new CloudConnectionProvider(MessageConverterProvider, ConnectionPoolSize, new ClientProvider(), Option.None<UpstreamProtocol>(), TokenProvider, DeviceScopeIdentitiesCache, TimeSpan.FromMinutes(60));

cloudConnectionProvider.BindEdgeHub(edgeHub);
var deviceIdentity1 = Mock.Of<IIdentity>(m => m.Id == "device1");
var clientCredentials1 = new SharedKeyCredentials(deviceIdentity1, "dummyConnStr", null);
Try<ICloudConnection> result = await cloudConnectionProvider.Connect(clientCredentials1, null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ async Task StartProtocolHead()

// CloudConnectionProvider and RoutingEdgeHub have a circular dependency. So set the
// EdgeHub on the CloudConnectionProvider before any other operation
var cloudConnectionProvider = this.container.Resolve<ICloudConnectionProvider>();
ICloudConnectionProvider cloudConnectionProvider = await this.container.Resolve<Task<ICloudConnectionProvider>>();
IEdgeHub edgeHub = await this.container.Resolve<Task<IEdgeHub>>();
cloudConnectionProvider.BindEdgeHub(edgeHub);

Expand Down

0 comments on commit 4f3ccd6

Please sign in to comment.