public void ThrowsAnExceptionIfTheFileDoesNotExist(Mock <IFileSystem> mockFileSystem, SplunkConfig config) { mockFileSystem.Setup(f => f.FileExists(It.IsAny <string>())).Returns(false); var loader = new SplunkConfigLoader(mockFileSystem.Object, "test"); Assert.Throws <FileNotFoundException>(() => loader.Load(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); }
public void LoadConfig(string splunkRCPath = null) { var loader = new SplunkConfigLoader(_fileSystem, splunkRCPath); loader.Load(Config); }