Skip to content

Commit 7695c50

Browse files
committed
#283 Adding xml documentation for the interfaces and public/protected methods.
1 parent f84772e commit 7695c50

5 files changed

Lines changed: 71 additions & 1 deletion

File tree

Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
namespace MyTested.AspNetCore.Mvc.Builders.Contracts.Data
22
{
3+
/// <summary>
4+
/// Used for adding AndAlso() method to the <see cref="Microsoft.Extensions.Caching.Distributed.IDistributedCache"/> builder.
5+
/// </summary>
36
public interface IAndWithoutDistributedCache : IWithoutDistributedCache
47
{
8+
/// <summary>
9+
/// AndAlso method for better readability when building <see cref="Microsoft.Extensions.Caching.Distributed.IDistributedCache"/>.
10+
/// </summary>
11+
/// <returns></returns>
512
IWithoutDistributedCache AndAlso();
613
}
714
}
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,38 @@
11
namespace MyTested.AspNetCore.Mvc.Builders.Contracts.Data
22
{
33
using System.Collections.Generic;
4+
using Microsoft.Extensions.Caching.Distributed;
45

6+
/// <summary>
7+
/// Used for building mocked <see cref="IDistributedCache"/>.
8+
/// </summary>
59
public interface IWithoutDistributedCache
610
{
11+
/// <summary>
12+
/// Remove cache entry to the mocked <see cref="IDistributedCache"/>.
13+
/// </summary>
14+
/// <param name="key">Key of the cache entry.</param>
15+
/// <returns>The same <see cref="IAndWithoutDistributedCache"/>.</returns>
716
IAndWithoutDistributedCache WithoutEntry(object key);
817

18+
/// <summary>
19+
/// Remove cache entries to the mocked <see cref="IDistributedCache"/>.
20+
/// </summary>
21+
/// <param name="keys">Keys of the cache entries.</param>
22+
/// <returns>The same <see cref="IAndWithoutDistributedCache"/>.</returns>
923
IAndWithoutDistributedCache WithoutEntries(IEnumerable<object> keys);
1024

25+
/// <summary>
26+
/// Remove cache params to the mocked <see cref="IDistributedCache"/>.
27+
/// </summary>
28+
/// <param name="keys">Keys of the cache entries.</param>
29+
/// <returns>The same <see cref="IAndWithoutDistributedCache"/>.</returns>
1130
IAndWithoutDistributedCache WithoutEntries(params object[] keys);
1231

32+
/// <summary>
33+
/// Clear all entries persisted into the <see cref="IDistributedCache"/>.
34+
/// </summary>
35+
/// <returns>The same <see cref="IAndWithoutDistributedCache"/>.</returns>
1336
IAndWithoutDistributedCache WithoutAllEntries();
1437
}
1538
}

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,15 @@
44
using Microsoft.Extensions.Caching.Distributed;
55
using Microsoft.Extensions.DependencyInjection;
66

7+
/// <summary>
8+
/// Used for building mocked <see cref="IDistributedCache"/>.
9+
/// </summary>
710
public abstract class BaseDistributedCacheBuilder
811
{
12+
/// <summary>
13+
/// Abstract <see cref="BaseDistributedCacheBuilder"/> class.
14+
/// </summary>
15+
/// <param name="services"><see cref="IServiceProvider"/> providing the current <see cref="IDistributedCache"/>.</param>
916
public BaseDistributedCacheBuilder(IServiceProvider services)
1017
=> this.DistributedCache = services.GetRequiredService<IDistributedCache>();
1118

src/MyTested.AspNetCore.Mvc.Caching/Builders/Data/DistributedCache/WithoutDistributedCache/WithoutDistributedCacheBuilder.cs

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
namespace MyTested.AspNetCore.Mvc.Builders.Data.DistributedCache.WithoutDistributedCache
22
{
33
using System;
4+
using System.Collections.Generic;
45
using Microsoft.Extensions.Caching.Distributed;
6+
using MyTested.AspNetCore.Mvc.Builders.Contracts.Data;
57

6-
public class WithoutDistributedCacheBuilder : BaseDistributedCacheBuilder
8+
public class WithoutDistributedCacheBuilder : BaseDistributedCacheBuilder, IAndWithoutDistributedCache
79
{
810
/// <summary>
911
/// Initializes a new instance of the <see cref="WithoutDistributedCacheBuilder"/> class.
@@ -13,5 +15,32 @@ public WithoutDistributedCacheBuilder(IServiceProvider services)
1315
: base(services)
1416
{
1517
}
18+
19+
/// <inheritdoc />
20+
public IAndWithoutDistributedCache WithoutAllEntries()
21+
{
22+
throw new NotImplementedException();
23+
}
24+
25+
/// <inheritdoc />
26+
public IAndWithoutDistributedCache WithoutEntries(IEnumerable<object> keys)
27+
{
28+
throw new NotImplementedException();
29+
}
30+
31+
/// <inheritdoc />
32+
public IAndWithoutDistributedCache WithoutEntries(params object[] keys)
33+
{
34+
throw new NotImplementedException();
35+
}
36+
37+
/// <inheritdoc />
38+
public IAndWithoutDistributedCache WithoutEntry(object key)
39+
{
40+
throw new NotImplementedException();
41+
}
42+
43+
/// <inheritdoc />
44+
public IWithoutDistributedCache AndAlso() => this;
1645
}
1746
}

src/MyTested.AspNetCore.Mvc.Caching/Builders/Data/MemoryCache/BaseMemoryCacheBuilder.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ public abstract class BaseMemoryCacheBuilder
1616
public BaseMemoryCacheBuilder(IServiceProvider services)
1717
=> this.MemoryCache = services.GetRequiredService<IMemoryCache>();
1818

19+
/// <summary>
20+
/// Gets the mocked <see cref="IMemoryCache"/>.
21+
/// </summary>
22+
/// <value>Built <see cref="IMemoryCache"/>.</value>
1923
protected IMemoryCache MemoryCache { get; private set; }
2024
}
2125
}

0 commit comments

Comments
 (0)