Commit 07455ae0 authored by Nick Craver's avatar Nick Craver

Fine, proper debug

parent 9ff0d203
...@@ -28,8 +28,8 @@ public void NullSnapshot() ...@@ -28,8 +28,8 @@ public void NullSnapshot()
Assert.Null(ex.InnerException); Assert.Null(ex.InnerException);
} }
#if DEBUG
[Fact] [Fact]
[Conditional("DEBUG")]
public void MultipleEndpointsThrowConnectionException() public void MultipleEndpointsThrowConnectionException()
{ {
try try
...@@ -58,7 +58,7 @@ public void MultipleEndpointsThrowConnectionException() ...@@ -58,7 +58,7 @@ public void MultipleEndpointsThrowConnectionException()
} }
[Fact] [Fact]
public void NullInnerExceptionForMultipleEndpointsWithNoLastException() public void ServerTakesPrecendenceOverSnapshot()
{ {
try try
{ {
...@@ -66,9 +66,13 @@ public void NullInnerExceptionForMultipleEndpointsWithNoLastException() ...@@ -66,9 +66,13 @@ public void NullInnerExceptionForMultipleEndpointsWithNoLastException()
{ {
var conn = muxer.GetDatabase(); var conn = muxer.GetDatabase();
muxer.AllowConnect = false; muxer.AllowConnect = false;
var ex = ExceptionFactory.NoConnectionAvailable(true, true, new RedisCommand(), null, null, muxer.GetServerSnapshot());
muxer.GetServer(muxer.GetEndPoints()[0]).SimulateConnectionFailure();
var ex = ExceptionFactory.NoConnectionAvailable(true, true, new RedisCommand(), null, muxer.GetServerSnapshot()[0], muxer.GetServerSnapshot());
Assert.IsType<RedisConnectionException>(ex); Assert.IsType<RedisConnectionException>(ex);
Assert.Null(ex.InnerException); Assert.IsType<RedisConnectionException>(ex.InnerException);
Assert.Equal(ex.InnerException, muxer.GetServerSnapshot()[0].LastException);
} }
} }
finally finally
...@@ -76,10 +80,10 @@ public void NullInnerExceptionForMultipleEndpointsWithNoLastException() ...@@ -76,10 +80,10 @@ public void NullInnerExceptionForMultipleEndpointsWithNoLastException()
ClearAmbientFailures(); ClearAmbientFailures();
} }
} }
#endif
[Fact] [Fact]
[Conditional("DEBUG")] public void NullInnerExceptionForMultipleEndpointsWithNoLastException()
public void ServerTakesPrecendenceOverSnapshot()
{ {
try try
{ {
...@@ -87,13 +91,9 @@ public void ServerTakesPrecendenceOverSnapshot() ...@@ -87,13 +91,9 @@ public void ServerTakesPrecendenceOverSnapshot()
{ {
var conn = muxer.GetDatabase(); var conn = muxer.GetDatabase();
muxer.AllowConnect = false; muxer.AllowConnect = false;
var ex = ExceptionFactory.NoConnectionAvailable(true, true, new RedisCommand(), null, null, muxer.GetServerSnapshot());
muxer.GetServer(muxer.GetEndPoints()[0]).SimulateConnectionFailure();
var ex = ExceptionFactory.NoConnectionAvailable(true, true, new RedisCommand(), null, muxer.GetServerSnapshot()[0], muxer.GetServerSnapshot());
Assert.IsType<RedisConnectionException>(ex); Assert.IsType<RedisConnectionException>(ex);
Assert.IsType<RedisConnectionException>(ex.InnerException); Assert.Null(ex.InnerException);
Assert.Equal(ex.InnerException, muxer.GetServerSnapshot()[0].LastException);
} }
} }
finally finally
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment