Skip to content

Commit 2cc68dd

Browse files
author
dmalanij
committed
Code cleanup in DefaultCacheKeyGeneratorTests
1 parent f6eb825 commit 2cc68dd

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

test/WebApi.OutputCache.V2.Tests/DefaultCacheKeyGeneratorTests.cs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
using NUnit.Framework;
22
using System;
3-
using System.Net.Http.Headers;
4-
using System.Web.Http.Controllers;
53

64
namespace WebApi.OutputCache.V2.Tests
75
{
@@ -19,7 +17,8 @@ public void NoParametersIncludeQueryString_ShouldReturnBaseKeyAndQueryStringAndM
1917
var cacheKey = cacheKeyGenerator.MakeCacheKey(context, mediaType, false);
2018

2119
AssertCacheKeysBasicFormat(cacheKey);
22-
Assert.AreEqual(String.Format("{0}-{1}:{2}", BaseCacheKey, requestUri.Query.Substring(1), mediaType), cacheKey, "Key does not match expected <BaseKey>-<QueryString>:<MediaType>");
20+
Assert.AreEqual(String.Format("{0}-{1}:{2}", BaseCacheKey, requestUri.Query.Substring(1), mediaType), cacheKey,
21+
"Key does not match expected <BaseKey>-<QueryString>:<MediaType>");
2322
}
2423

2524
[Test]
@@ -28,7 +27,8 @@ public void NoParametersExcludeQueryString_ShouldReturnBaseKeyAndMediaTypeConcat
2827
var cacheKey = cacheKeyGenerator.MakeCacheKey(context, mediaType, true);
2928

3029
AssertCacheKeysBasicFormat(cacheKey);
31-
Assert.AreEqual(String.Format("{0}:{1}", BaseCacheKey, mediaType), cacheKey, "Key does not match expected <BaseKey>:<MediaType>");
30+
Assert.AreEqual(String.Format("{0}:{1}", BaseCacheKey, mediaType), cacheKey,
31+
"Key does not match expected <BaseKey>:<MediaType>");
3232
}
3333

3434
[Test]
@@ -38,7 +38,8 @@ public void WithParametersIncludeQueryString_ShouldReturnBaseKeyAndArgumentsAndQ
3838
var cacheKey = cacheKeyGenerator.MakeCacheKey(context, mediaType, false);
3939

4040
AssertCacheKeysBasicFormat(cacheKey);
41-
Assert.AreEqual(String.Format("{0}-{1}&{2}:{3}", BaseCacheKey, FormatActionArgumentsForKeyAssertion(), requestUri.Query.Substring(1), mediaType), cacheKey, "Key does not match expected <BaseKey>-<Arguments>&<QueryString>:<MediaType>");
41+
Assert.AreEqual(String.Format("{0}-{1}&{2}:{3}", BaseCacheKey, FormatActionArgumentsForKeyAssertion(), requestUri.Query.Substring(1), mediaType), cacheKey,
42+
"Key does not match expected <BaseKey>-<Arguments>&<QueryString>:<MediaType>");
4243
}
4344

4445
[Test]
@@ -48,7 +49,8 @@ public void WithParametersExcludeQueryString_ShouldReturnBaseKeyAndArgumentsAndM
4849
var cacheKey = cacheKeyGenerator.MakeCacheKey(context, mediaType, true);
4950

5051
AssertCacheKeysBasicFormat(cacheKey);
51-
Assert.AreEqual(String.Format("{0}-{1}:{2}", BaseCacheKey, FormatActionArgumentsForKeyAssertion(), mediaType), cacheKey, "Key does not match expected <BaseKey>-<Arguments>:<MediaType>");
52+
Assert.AreEqual(String.Format("{0}-{1}:{2}", BaseCacheKey, FormatActionArgumentsForKeyAssertion(), mediaType), cacheKey,
53+
"Key does not match expected <BaseKey>-<Arguments>:<MediaType>");
5254
}
5355
}
5456
}

0 commit comments

Comments
 (0)