public Load ( |
||
config | ||
Результат | void |
public void Load(SplunkConfig config)
{
if (!_fileSystem.FileExists(SplunkRCPath))
{
throw new FileNotFoundException(".splunkrc file not found", SplunkRCPath);
}
var lines = _fileSystem.ReadFileLines(SplunkRCPath);
GetSettings(lines, config);
}
private SplunkConfig LoadTestConfig(Mock<IFileSystem> mockFileSystem) { var config = new SplunkConfig(); mockFileSystem.Setup(fs => fs.FileExists(It.IsAny<string>())).Returns(true); mockFileSystem.Setup(fs => fs.ReadFileLines(It.IsAny<string>())).Returns(TestConfigLoader.GetSplunkRC()); var loader = new SplunkConfigLoader(mockFileSystem.Object); loader.Load(config); return config; }