Your ROOT_URL in app.ini is https://git.cloudchain.link/ but you are visiting https://dash.bss.nz/open-source-mirrors/Sonarr/src/commit/3c53e6009d837a0d33fd3b7889c8cfe7d6828c88/NzbDrone.Core.Test/Configuration/ConfigCachingFixture.cs You should set ROOT_URL correctly, otherwise the web may not work correctly.
Sonarr/NzbDrone.Core.Test/Configuration/ConfigCachingFixture.cs

35 lines
949 B

using System.Collections.Generic;
using System.Linq;
using FluentAssertions;
using Moq;
using NUnit.Framework;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.Test.Framework;
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());
}
}
}