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

Fine, proper debug

parent 9ff0d203
......@@ -28,8 +28,8 @@ public void NullSnapshot()
Assert.Null(ex.InnerException);
}
#if DEBUG
[Fact]
[Conditional("DEBUG")]
public void MultipleEndpointsThrowConnectionException()
{
try
......@@ -58,7 +58,7 @@ public void MultipleEndpointsThrowConnectionException()
}
[Fact]
public void NullInnerExceptionForMultipleEndpointsWithNoLastException()
public void ServerTakesPrecendenceOverSnapshot()
{
try
{
......@@ -66,9 +66,13 @@ public void NullInnerExceptionForMultipleEndpointsWithNoLastException()
{
var conn = muxer.GetDatabase();
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.Null(ex.InnerException);
Assert.IsType<RedisConnectionException>(ex.InnerException);
Assert.Equal(ex.InnerException, muxer.GetServerSnapshot()[0].LastException);
}
}
finally
......@@ -76,10 +80,10 @@ public void NullInnerExceptionForMultipleEndpointsWithNoLastException()
ClearAmbientFailures();
}
}
#endif
[Fact]
[Conditional("DEBUG")]
public void ServerTakesPrecendenceOverSnapshot()
public void NullInnerExceptionForMultipleEndpointsWithNoLastException()
{
try
{
......@@ -87,13 +91,9 @@ public void ServerTakesPrecendenceOverSnapshot()
{
var conn = muxer.GetDatabase();
muxer.AllowConnect = false;
muxer.GetServer(muxer.GetEndPoints()[0]).SimulateConnectionFailure();
var ex = ExceptionFactory.NoConnectionAvailable(true, true, new RedisCommand(), null, muxer.GetServerSnapshot()[0], muxer.GetServerSnapshot());
var ex = ExceptionFactory.NoConnectionAvailable(true, true, new RedisCommand(), null, null, muxer.GetServerSnapshot());
Assert.IsType<RedisConnectionException>(ex);
Assert.IsType<RedisConnectionException>(ex.InnerException);
Assert.Equal(ex.InnerException, muxer.GetServerSnapshot()[0].LastException);
Assert.Null(ex.InnerException);
}
}
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