mirror of
https://github.com/Sonarr/Sonarr
synced 2025-01-22 15:19:10 +00:00
cleaned DbConfigControllerTest
This commit is contained in:
parent
4c83d8d6ed
commit
22ec10483a
1 changed files with 8 additions and 8 deletions
|
@ -13,17 +13,18 @@ using SubSonic.Repository;
|
||||||
namespace NzbDrone.Core.Test
|
namespace NzbDrone.Core.Test
|
||||||
{
|
{
|
||||||
[TestFixture]
|
[TestFixture]
|
||||||
|
// ReSharper disable InconsistentNaming
|
||||||
public class DbConfigControllerTest
|
public class DbConfigControllerTest
|
||||||
{
|
{
|
||||||
[Test]
|
[Test]
|
||||||
public void Overwrite_existing_value()
|
public void Overwrite_existing_value()
|
||||||
{
|
{
|
||||||
String key = "MY_KEY";
|
const string key = "MY_KEY";
|
||||||
String value = "MY_VALUE";
|
const string value = "MY_VALUE";
|
||||||
|
|
||||||
//setup
|
//Arrange
|
||||||
var repo = new Mock<IRepository>();
|
var repo = new Mock<IRepository>();
|
||||||
var config = new Config() { Key = key, Value = value };
|
var config = new Config { Key = key, Value = value };
|
||||||
repo.Setup(r => r.Single<Config>(key)).Returns(config);
|
repo.Setup(r => r.Single<Config>(key)).Returns(config);
|
||||||
var target = new DbConfigController(new Mock<ILog>().Object, repo.Object);
|
var target = new DbConfigController(new Mock<ILog>().Object, repo.Object);
|
||||||
|
|
||||||
|
@ -38,12 +39,11 @@ namespace NzbDrone.Core.Test
|
||||||
[Test]
|
[Test]
|
||||||
public void Add_new_value()
|
public void Add_new_value()
|
||||||
{
|
{
|
||||||
String key = "MY_KEY";
|
const string key = "MY_KEY";
|
||||||
String value = "MY_VALUE";
|
const string value = "MY_VALUE";
|
||||||
|
|
||||||
//setup
|
//Arrange
|
||||||
var repo = new Mock<IRepository>();
|
var repo = new Mock<IRepository>();
|
||||||
var config = new Config() { Key = key, Value = value };
|
|
||||||
repo.Setup(r => r.Single<Config>(It.IsAny<string>())).Returns<Config>(null).Verifiable();
|
repo.Setup(r => r.Single<Config>(It.IsAny<string>())).Returns<Config>(null).Verifiable();
|
||||||
var target = new DbConfigController(new Mock<ILog>().Object, repo.Object);
|
var target = new DbConfigController(new Mock<ILog>().Object, repo.Object);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue