Commit 47301faa authored by Nick Craver's avatar Nick Craver

nameof() cleanup

parent dcf17987
...@@ -10,7 +10,7 @@ namespace StackExchange.Redis.Tests ...@@ -10,7 +10,7 @@ namespace StackExchange.Redis.Tests
public class Locking : TestBase public class Locking : TestBase
{ {
[Test] [Test]
[TestCaseSource("TestModes")] [TestCaseSource(nameof(TestModes))]
public void AggressiveParallel(TestMode testMode) public void AggressiveParallel(TestMode testMode)
{ {
int count = 2; int count = 2;
...@@ -132,7 +132,7 @@ public static IEnumerable<TestMode> TestModes() ...@@ -132,7 +132,7 @@ public static IEnumerable<TestMode> TestModes()
return (TestMode[])Enum.GetValues(typeof(TestMode)); return (TestMode[])Enum.GetValues(typeof(TestMode));
} }
[Test] [Test]
[TestCaseSource("TestModes")] [TestCaseSource(nameof(TestModes))]
public void TakeLockAndExtend(TestMode mode) public void TakeLockAndExtend(TestMode mode)
{ {
bool withTran = mode == TestMode.MultiExec; bool withTran = mode == TestMode.MultiExec;
...@@ -219,7 +219,7 @@ public void TakeLockAndExtend(TestMode mode) ...@@ -219,7 +219,7 @@ public void TakeLockAndExtend(TestMode mode)
[Test] [Test]
[TestCaseSource("TestModes")] [TestCaseSource(nameof(TestModes))]
public void TestBasicLockNotTaken(TestMode testMode) public void TestBasicLockNotTaken(TestMode testMode)
{ {
using (var conn = Create(testMode)) using (var conn = Create(testMode))
...@@ -249,7 +249,7 @@ public void TestBasicLockNotTaken(TestMode testMode) ...@@ -249,7 +249,7 @@ public void TestBasicLockNotTaken(TestMode testMode)
} }
[Test] [Test]
[TestCaseSource("TestModes")] [TestCaseSource(nameof(TestModes))]
public void TestBasicLockTaken(TestMode testMode) public void TestBasicLockTaken(TestMode testMode)
{ {
using (var conn = Create(testMode)) using (var conn = Create(testMode))
......
...@@ -257,8 +257,8 @@ private static RedisConnection GetOldStyleConnection(string host, int port, bool ...@@ -257,8 +257,8 @@ private static RedisConnection GetOldStyleConnection(string host, int port, bool
#endif #endif
protected static TimeSpan RunConcurrent(Action work, int threads, int timeout = 10000, [CallerMemberName] string caller = null) protected static TimeSpan RunConcurrent(Action work, int threads, int timeout = 10000, [CallerMemberName] string caller = null)
{ {
if (work == null) throw new ArgumentNullException("work"); if (work == null) throw new ArgumentNullException(nameof(work));
if (threads < 1) throw new ArgumentOutOfRangeException("threads"); if (threads < 1) throw new ArgumentOutOfRangeException(nameof(threads));
if(string.IsNullOrWhiteSpace(caller)) caller = Me(); if(string.IsNullOrWhiteSpace(caller)) caller = Me();
Stopwatch watch = null; Stopwatch watch = null;
ManualResetEvent allDone = new ManualResetEvent(false); ManualResetEvent allDone = new ManualResetEvent(false);
......
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