PCRB follow up client side logic
This commit is contained in:
18
MesaFabApproval.Client.Test/MockMemoryCacheService.cs
Normal file
18
MesaFabApproval.Client.Test/MockMemoryCacheService.cs
Normal file
@ -0,0 +1,18 @@
|
||||
using Microsoft.Extensions.Caching.Memory;
|
||||
|
||||
using Moq;
|
||||
|
||||
namespace MesaFabApproval.Client.Test;
|
||||
|
||||
public static class MockMemoryCacheService {
|
||||
public static Mock<IMemoryCache> GetMemoryCache(object expectedValue) {
|
||||
Mock<IMemoryCache> mockMemoryCache = new Mock<IMemoryCache>();
|
||||
mockMemoryCache
|
||||
.Setup(x => x.TryGetValue(It.IsAny<object>(), out expectedValue))
|
||||
.Returns(true);
|
||||
mockMemoryCache
|
||||
.Setup(x => x.CreateEntry(It.IsAny<object>()))
|
||||
.Returns(Mock.Of<ICacheEntry>());
|
||||
return mockMemoryCache;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user