mirror of
https://github.com/SoPat712/allstarr.git
synced 2026-10-08 06:05:02 -04:00
38 lines
1.2 KiB
C#
38 lines
1.2 KiB
C#
using System.Reflection;
|
|
using allstarr.Services.Common;
|
|
|
|
namespace allstarr.Tests;
|
|
|
|
public sealed class ApplicationCacheContractTests
|
|
{
|
|
[Fact]
|
|
public void ProductionFacade_ImplementsApplicationCacheContract()
|
|
{
|
|
Assert.True(typeof(IApplicationCache).IsAssignableFrom(typeof(BoundedHotApplicationCache)));
|
|
}
|
|
|
|
[Fact]
|
|
public void ApplicationCacheContract_ContainsOnlyDisposableCacheOperations()
|
|
{
|
|
var methodNames = typeof(IApplicationCache)
|
|
.GetMethods(BindingFlags.Public | BindingFlags.Instance)
|
|
.Select(method => method.Name)
|
|
.ToHashSet(StringComparer.Ordinal);
|
|
|
|
Assert.Equal(
|
|
new HashSet<string>(StringComparer.Ordinal)
|
|
{
|
|
"get_IsEnabled",
|
|
nameof(IApplicationCache.GetStringAsync),
|
|
nameof(IApplicationCache.GetAsync),
|
|
nameof(IApplicationCache.SetStringAsync),
|
|
nameof(IApplicationCache.SetAsync),
|
|
nameof(IApplicationCache.DeleteAsync),
|
|
nameof(IApplicationCache.ExistsAsync),
|
|
nameof(IApplicationCache.DeleteByPatternAsync),
|
|
nameof(IApplicationCache.PurgeAllAsync),
|
|
},
|
|
methodNames);
|
|
}
|
|
}
|