Fixed some small issues, here and there.

This commit is contained in:
kay.one 2011-06-17 19:51:53 -07:00
commit f4a765817b
6 changed files with 44 additions and 14 deletions

View file

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