1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2026-04-21 22:05:38 -04:00

Saving settings failed if value was null.

This commit is contained in:
Taloth Saldono
2016-11-02 00:02:14 +01:00
parent 0411b82e65
commit 1251e294cd
3 changed files with 18 additions and 3 deletions
@@ -108,5 +108,19 @@ namespace NzbDrone.Core.Test.Configuration
keys.Should().OnlyHaveUniqueItems();
}
[Test]
public void should_ignore_null_properties()
{
Mocker.GetMock<IConfigRepository>()
.Setup(v => v.Get("downloadedepisodesfolder"))
.Returns(new Config { Id = 1, Key = "DownloadedEpisodesFolder", Value = @"C:\test".AsOsAgnostic() });
var dict = new Dictionary<string, object>();
dict.Add("DownloadedEpisodesFolder", null);
Subject.SaveConfigDictionary(dict);
Mocker.GetMock<IConfigRepository>().Verify(c => c.Upsert("downloadedepisodesfolder", It.IsAny<string>()), Times.Never());
}
}
}
}