1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-10-30 07:22:35 +01:00

cleaned DbConfigControllerTest

This commit is contained in:
kay.one 2010-09-24 11:14:15 -07:00
parent 4c83d8d6ed
commit 22ec10483a

View File

@ -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);