Skip to content

Commit 2565aec

Browse files
committed
Fixed code styling issues (#247)
1 parent 33321b7 commit 2565aec

File tree

6 files changed

+9
-22
lines changed

6 files changed

+9
-22
lines changed

src/MyTested.AspNetCore.Mvc.Caching/Builders/Contracts/Data/DistributedCache/IDistributedCacheBuilder.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,5 @@ public interface IDistributedCacheBuilder
6363
/// <param name="entries">Dictionary of cache entries.</param>
6464
/// <returns>The same <see cref="IAndDistributedCacheBuilder"/>.</returns>
6565
IAndDistributedCacheBuilder WithEntries(IDictionary<string, string> entries);
66-
6766
}
6867
}

src/MyTested.AspNetCore.Mvc.Caching/Builders/Contracts/Data/DistributedCache/IDistributedCacheTestBuilder.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,5 @@ public interface IDistributedCacheTestBuilder
8484
/// <param name="entries">Dictionary of cache entries.</param>
8585
/// <returns>The same <see cref="IAndDistributedCacheTestBuilder"/>.</returns>
8686
IAndDistributedCacheTestBuilder ContainingEntries(IDictionary<string, string> entries);
87-
8887
}
8988
}

src/MyTested.AspNetCore.Mvc.Caching/Builders/Data/DistributedCache/DistributedCacheBuilder.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@ public class DistributedCacheBuilder : IAndDistributedCacheBuilder
1414
/// </summary>
1515
/// <param name="services"><see cref="IServiceProvider"/> providing the current <see cref="IDistributedCache"/>.</param>
1616
public DistributedCacheBuilder(IServiceProvider services)
17-
{
18-
this.DistributedCache = services.GetRequiredService<IDistributedCache>();
19-
}
17+
=> this.DistributedCache = services.GetRequiredService<IDistributedCache>();
2018

2119
/// <summary>
2220
/// Gets the mocked <see cref="IDistributedCache"/>.

src/MyTested.AspNetCore.Mvc.Caching/Builders/Data/DistributedCache/DistributedCacheEntryTestBuilder.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
namespace MyTested.AspNetCore.Mvc.Builders.Data.DistributedCache
22
{
33
using System;
4-
using Contracts.Data.DistributedCache;
54
using System.Collections.Generic;
5+
using Contracts.Data.DistributedCache;
6+
using Exceptions;
7+
using Internal.Caching;
68
using Internal.TestContexts;
79
using Utilities;
810
using Utilities.Validators;
9-
using Exceptions;
10-
using Internal.Caching;
1111
using Utilities.Extensions;
1212

1313
public class DistributedCacheEntryTestBuilder : DistributedCacheEntryBuilder, IDistributedCacheEntryKeyTestBuilder, IAndDistributedCacheEntryTestBuilder
@@ -115,12 +115,10 @@ internal ICollection<Action<DistributedCacheEntry, DistributedCacheEntry>> GetDi
115115
=> this.validations;
116116

117117
internal void ThrowNewDataProviderAssertionException(string expectedValue, string actualValue)
118-
{
119-
throw new DataProviderAssertionException(string.Format(
118+
=> throw new DataProviderAssertionException(string.Format(
120119
"{0} distributed cache {1}, but {2}.",
121120
this.TestContext.ExceptionMessagePrefix,
122121
expectedValue,
123122
actualValue));
124-
}
125123
}
126124
}

src/MyTested.AspNetCore.Mvc.Caching/Builders/Data/DistributedCache/DistributedCacheTestBuilder.cs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,7 @@ public IAndDistributedCacheTestBuilder ContainingEntry(Action<IDistributedCacheE
137137
this.ContainingEntryWithKey(entryKey);
138138

139139
mockedDistributedCache.TryGetCacheEntryOptions(entryKey, out var actualDistributedCacheEntryOptions);
140-
var actualDistributedCacheEntryValue
141-
= mockedDistributedCache.Get(entryKey);
140+
var actualDistributedCacheEntryValue = mockedDistributedCache.Get(entryKey);
142141

143142
var actualDistributedCacheEntry = new DistributedCacheEntry(actualDistributedCacheEntryValue, actualDistributedCacheEntryOptions);
144143

@@ -178,12 +177,10 @@ public IAndDistributedCacheTestBuilder ContainingEntryWithValue(byte[] value)
178177
public IDistributedCacheTestBuilder AndAlso() => this;
179178

180179
private IDistributedCache GetDistributedCache()
181-
{
182-
return this.TestContext
180+
=> this.TestContext
183181
.HttpContext
184182
.RequestServices
185183
.GetRequiredService<IDistributedCache>();
186-
}
187184

188185
private IDistributedCacheMock GetDistributedCacheMock()
189186
{
@@ -214,13 +211,11 @@ private byte[] GetValue(string key)
214211
}
215212

216213
private void ThrowNewDataProviderAssertionException(string propertyName, string expectedValue, string actualValue)
217-
{
218-
throw new DataProviderAssertionException(string.Format(
214+
=> throw new DataProviderAssertionException(string.Format(
219215
"{0} {1} {2}, but {3}.",
220216
this.TestContext.ExceptionMessagePrefix,
221217
propertyName,
222218
expectedValue,
223219
actualValue));
224-
}
225220
}
226221
}

src/MyTested.AspNetCore.Mvc.Caching/Internal/Caching/DistributedCacheMock.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,6 @@ public Dictionary<string, byte[]> GetCacheAsDictionary()
8181
=> this.cache.ToDictionary(kvp => kvp.Key, kvp => kvp.Value.Value);
8282

8383
public void Dispose()
84-
{
85-
this.cache.Clear();
86-
}
84+
=> this.cache.Clear();
8785
}
8886
}

0 commit comments

Comments
 (0)