mirror of
https://github.com/lidarr/Lidarr
synced 2024-12-30 19:45:57 +00:00
4da6654440
Added caching to ConfigFileProvider,
34 lines
No EOL
768 B
C#
34 lines
No EOL
768 B
C#
using System;
|
|
using FluentAssertions;
|
|
using NUnit.Framework;
|
|
using NzbDrone.Common.Cache;
|
|
using NzbDrone.Test.Common;
|
|
|
|
namespace NzbDrone.Common.Test.CacheTests
|
|
{
|
|
[TestFixture]
|
|
public class CachedManagerFixture:TestBase<ICacheManger>
|
|
{
|
|
[Test]
|
|
public void should_return_proper_type_of_cache()
|
|
{
|
|
var result = Subject.GetCache<DateTime>(typeof(string));
|
|
|
|
result.Should().BeOfType<Cached<DateTime>>();
|
|
}
|
|
|
|
|
|
[Test]
|
|
public void multiple_calls_should_get_the_same_cache()
|
|
{
|
|
var result1 = Subject.GetCache<DateTime>(typeof(string));
|
|
var result2 = Subject.GetCache<DateTime>(typeof(string));
|
|
|
|
result1.Should().BeSameAs(result2);
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
} |