mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 10:47:08 -07:00
post grab notification and updates are now using the new EventAggregator
This commit is contained in:
parent
13658e3c6d
commit
554924a522
40 changed files with 670 additions and 482 deletions
34
NzbDrone.Core.Test/Configuration/ConfigCachingFixture.cs
Normal file
34
NzbDrone.Core.Test/Configuration/ConfigCachingFixture.cs
Normal file
|
@ -0,0 +1,34 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using FluentAssertions;
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
using NzbDrone.Core.Configuration;
|
||||
using NzbDrone.Core.Test.Framework;
|
||||
using PetaPoco;
|
||||
|
||||
namespace NzbDrone.Core.Test.Configuration
|
||||
{
|
||||
[TestFixture]
|
||||
public class ConfigCachingFixture : CoreTest<ConfigService>
|
||||
{
|
||||
[SetUp]
|
||||
public void Setup()
|
||||
{
|
||||
Mocker.GetMock<IConfigRepository>().Setup(c => c.All())
|
||||
.Returns(new List<Config> { new Config { Key = "Key1", Value = "Value1" } });
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void getting_value_more_than_once_should_hit_db_once()
|
||||
{
|
||||
Subject.GetValue("Key1", null).Should().Be("Value1");
|
||||
Subject.GetValue("Key1", null).Should().Be("Value1");
|
||||
Subject.GetValue("Key1", null).Should().Be("Value1");
|
||||
|
||||
Mocker.GetMock<IConfigRepository>().Verify(c => c.All(), Times.Once());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue