mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 02:37:08 -07:00
Fixed some small issues, here and there.
This commit is contained in:
parent
45a51497b6
commit
f4a765817b
6 changed files with 44 additions and 14 deletions
|
@ -39,6 +39,7 @@ namespace NzbDrone.Core.Test
|
|||
mocker.SetConstant(db);
|
||||
|
||||
db.Insert(new Config { Key = key, Value = value });
|
||||
db.Insert(new Config { Key = "Other Key", Value = "OtherValue" });
|
||||
|
||||
//Act
|
||||
var result = mocker.Resolve<ConfigProvider>().GetValue(key, "");
|
||||
|
@ -67,7 +68,7 @@ namespace NzbDrone.Core.Test
|
|||
}
|
||||
|
||||
[Test]
|
||||
public void New_value_should_update_old_value()
|
||||
public void New_value_should_update_old_value_new_value()
|
||||
{
|
||||
const string key = "MY_KEY";
|
||||
const string originalValue = "OLD_VALUE";
|
||||
|
@ -88,5 +89,26 @@ namespace NzbDrone.Core.Test
|
|||
db.Fetch<Config>().Should().HaveCount(1);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void New_value_should_update_old_value_same_value()
|
||||
{
|
||||
const string key = "MY_KEY";
|
||||
const string value = "OLD_VALUE";
|
||||
|
||||
|
||||
var mocker = new AutoMoqer();
|
||||
var db = MockLib.GetEmptyDatabase();
|
||||
mocker.SetConstant(db);
|
||||
|
||||
//Act
|
||||
mocker.Resolve<ConfigProvider>().SetValue(key, value);
|
||||
mocker.Resolve<ConfigProvider>().SetValue(key, value);
|
||||
var result = mocker.Resolve<ConfigProvider>().GetValue(key, "");
|
||||
|
||||
//Assert
|
||||
result.Should().Be(value);
|
||||
db.Fetch<Config>().Should().HaveCount(1);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue