public void GivenThatIUnsetASingleValueVerifyItIsGone() { var json = JsonUtility.Create(new Uri("http://tempuri.org/settings.json"), "Settings"); var values = new Dictionary <string, string>(StringComparer.OrdinalIgnoreCase) { { "a", "1" }, { "b", "2" }, { "c", "3" }, }; var values2 = new Dictionary <string, string>(StringComparer.OrdinalIgnoreCase) { { "a", "1" }, { "c", "3" }, }; FeedSettingsUtility.Set(json, values); FeedSettingsUtility.Set(json, values2); var actual = FeedSettingsUtility.GetSettings(json); actual.ShouldBeEquivalentTo(values2); }
public void GivenThatIWriteSettingsVerifyTheyPersistForUnknownValues() { var json = JsonUtility.Create(new Uri("http://tempuri.org/settings.json"), "Settings"); var values = new Dictionary <string, string>(StringComparer.OrdinalIgnoreCase) { { "a", "1" }, { "b", "2" }, { "c", "3" }, }; FeedSettingsUtility.Set(json, values); var actual = FeedSettingsUtility.GetSettings(json); actual.ShouldBeEquivalentTo(values); }
public void GivenThatIWriteSettingsVerifyTheyPersist() { var json = JsonUtility.Create(new Uri("http://tempuri.org/settings.json"), "Settings"); var values = new Dictionary <string, string>(StringComparer.OrdinalIgnoreCase) { { "catalogenabled", "true" }, { "symbolsfeedenabled", "true" }, { "catalogpagesize", "10" }, }; FeedSettingsUtility.Set(json, values); var actual = FeedSettingsUtility.GetSettings(json); actual.ShouldBeEquivalentTo(values); }
public void GivenThatIUnsetAllVerifyNoSettings() { var json = JsonUtility.Create(new Uri("http://tempuri.org/settings.json"), "Settings"); var values = new Dictionary <string, string>(StringComparer.OrdinalIgnoreCase) { { "a", "1" }, { "b", "2" }, { "c", "3" }, }; FeedSettingsUtility.Set(json, values); FeedSettingsUtility.UnsetAll(json); var actual = FeedSettingsUtility.GetSettings(json); actual.Should().BeEmpty(); }