mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-22 14:33:30 -07:00
added new in memory cache.
This commit is contained in:
parent
d1eec340e0
commit
098036d49a
7 changed files with 202 additions and 0 deletions
33
NzbDrone.Common.Test/CacheTests/CachedManagerFixture.cs
Normal file
33
NzbDrone.Common.Test/CacheTests/CachedManagerFixture.cs
Normal file
|
@ -0,0 +1,33 @@
|
|||
using System;
|
||||
using FluentAssertions;
|
||||
using NUnit.Framework;
|
||||
using NzbDrone.Common.Cache;
|
||||
|
||||
namespace NzbDrone.Common.Test.CacheTests
|
||||
{
|
||||
[TestFixture]
|
||||
public class CachedManagerFixture
|
||||
{
|
||||
[Test]
|
||||
public void should_return_proper_type_of_cache()
|
||||
{
|
||||
var result = CacheManger.GetCache<DateTime>(typeof(string));
|
||||
|
||||
result.Should().BeOfType<Cached<DateTime>>();
|
||||
}
|
||||
|
||||
|
||||
[Test]
|
||||
public void multiple_calls_should_get_the_same_cache()
|
||||
{
|
||||
var result1 = CacheManger.GetCache<DateTime>(typeof(string));
|
||||
var result2 = CacheManger.GetCache<DateTime>(typeof(string));
|
||||
|
||||
result1.Should().BeSameAs(result2);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue