Skip to content

Commit

Permalink
Updated HubException related tests to address code review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
halter73 committed Aug 14, 2013
1 parent a60d923 commit 0b71d56
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@ testUtilities.runWithAllTransports(function (transport) {
end();
})
.fail(function (error) {
assert.equal(error.message, "message");
assert.equal(error.data, "errorData");
assert.equal(error.source, "HubException");
assert.equal(error.message, "message", "The error message should be 'message'.");
assert.equal(error.data, "errorData", "The error.data property should be 'errorData'.");
assert.equal(error.source, "HubException", "The error.source property should be 'HubException'");
end();
});
});
Expand All @@ -141,9 +141,9 @@ testUtilities.runWithAllTransports(function (transport) {
end();
})
.fail(function (error) {
assert.equal(error.message, "message");
assert.isNotSet(error.data);
assert.equal(error.source, "HubException");
assert.equal(error.message, "message", "The error message should be 'message'.");
assert.isNotSet(error.data, "The error.data property should be absent.");
assert.equal(error.source, "HubException", "The error.source property should be 'HubException'");
end();
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ public void DetailedErrorsAreDisabledByDefault(HostType hostType, TransportType
[InlineData(HostType.HttpListener, TransportType.ServerSentEvents, MessageBusType.Default)]
[InlineData(HostType.HttpListener, TransportType.Websockets, MessageBusType.Default)]
[InlineData(HostType.HttpListener, TransportType.LongPolling, MessageBusType.Default)]
public void DetailedErrorsAreAlwaysGivenForHubExceptions(HostType hostType, TransportType transportType, MessageBusType messageBusType)
public async Task DetailedErrorsAreAlwaysGivenForHubExceptions(HostType hostType, TransportType transportType, MessageBusType messageBusType)
{
using (var host = CreateHost(hostType, transportType))
{
Expand All @@ -567,7 +567,7 @@ public void DetailedErrorsAreAlwaysGivenForHubExceptions(HostType hostType, Tran

var hub = connection.CreateHubProxy("demo");

connection.Start(host.TransportFactory()).Wait();
await connection.Start(host.TransportFactory());

var ex = Assert.Throws<AggregateException>(() => hub.InvokeWithTimeout("HubException"));

Expand All @@ -591,7 +591,7 @@ public void DetailedErrorsAreAlwaysGivenForHubExceptions(HostType hostType, Tran
[InlineData(HostType.HttpListener, TransportType.ServerSentEvents, MessageBusType.Default)]
[InlineData(HostType.HttpListener, TransportType.Websockets, MessageBusType.Default)]
[InlineData(HostType.HttpListener, TransportType.LongPolling, MessageBusType.Default)]
public void DetailedErrorsAreAlwaysGivenForHubExceptionsWithoutErrorData(HostType hostType, TransportType transportType, MessageBusType messageBusType)
public async Task DetailedErrorsAreAlwaysGivenForHubExceptionsWithoutErrorData(HostType hostType, TransportType transportType, MessageBusType messageBusType)
{
using (var host = CreateHost(hostType, transportType))
{
Expand All @@ -603,7 +603,7 @@ public void DetailedErrorsAreAlwaysGivenForHubExceptionsWithoutErrorData(HostTyp

var hub = connection.CreateHubProxy("demo");

connection.Start(host.TransportFactory()).Wait();
await connection.Start(host.TransportFactory());

var ex = Assert.Throws<AggregateException>(() => hub.InvokeWithTimeout("HubExceptionWithoutErrorData"));

Expand Down

0 comments on commit 0b71d56

Please sign in to comment.