本文整理汇总了C#中ConfigManager.SaveAll方法的典型用法代码示例。如果您正苦于以下问题:C# ConfigManager.SaveAll方法的具体用法?C# ConfigManager.SaveAll怎么用?C# ConfigManager.SaveAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ConfigManager
的用法示例。
在下文中一共展示了ConfigManager.SaveAll方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestSaveAllConfigs
public void TestSaveAllConfigs()
{
var provider = new ConfigProviderMock();
var serializer = new ConfigSerializerMock();
var manager = new ConfigManager(provider, serializer);
manager.SaveAll();
provider.ReadConfigs.Should().BeEmpty("the manager should have not tried to read any configs");
provider.WrittenConfigs.Should().BeEmpty("the manager should not have tried to write any configs");
serializer.Serialized.Should().BeEmpty("the manager should not have tried to serialize any configs");
serializer.Deserialized.Should().BeEmpty("the manager should have tried to deserialize any configs");
manager.Get<ConfigMock>();
manager.SaveAll();
provider.WrittenConfigs.Should().ContainSingle("the manager should have tried to write the config");
provider.WrittenConfigs[0].Key.Should().Be(typeof(ConfigMock), "the written config should be the same as the requested one");
serializer.Serialized.Should().ContainSingle("the manager should have tried to serialize the config");
serializer.Serialized[0].Key.Should().Be(typeof(ConfigMock), "the serialized config should be the same as the requested one");
manager.SaveAll();
provider.WrittenConfigs.Should().ContainSingle("the manager should not have tried to re-write an unmodified config");
}