public TestRepository(ITestFileReader testFileReader, ITestFileWriter testFileWriter, IFileHandler fileHandler, IConfiguration configuration) { _testFileReader = testFileReader; _testFileWriter = testFileWriter; _fileHandler = fileHandler; _configuration = configuration; }
public JsUnitTestRunner( [NotNull] IWebServer webServer, [NotNull] FixtureRunner fixtureRunner, [NotNull] ITestFileReader testFileReader, [NotNull] IFixtureFinder fixtureFinder) { this.webServer = webServer; this.fixtureRunner = fixtureRunner; this.testFileReader = testFileReader; this.fixtureFinder = fixtureFinder; }
public SuffixTestFileReader([NotNullOrEmpty] string postFix, [NotNull] ITestFileReader adaptee) : base(adaptee) { this.postFix = postFix; }
public void Map(string match, ITestFileReader reader) { readers.Add(match, reader); }
public TestRepository(ITestFileReader testFileReader, ITestFileWriter testFileWriter, IFileHandler fileHandler) { _testFileReader = testFileReader; _testFileWriter = testFileWriter; _fileHandler = fileHandler; }
// Methods public SuiteBuilder(ITemplates templates, ITestFileReader reader, ITestFileReader sourceReader) { this.templates = templates; this.reader = reader; this.sourceReader = sourceReader; }
public ExcludeTestFileReader([NotNullOrEmpty] string excludePhrase, [NotNull] ITestFileReader adaptee) : base(adaptee) { this.excludePhrase = excludePhrase; }
public bool Init(string path, string resourcePath) { timeStamp = DateTime.Now; DataStore.Initialize(); _testFileReader = new TestFileReader(_fileService); Dictionary <string, string> testVariables = new Dictionary <string, string>(); // read the resource file, if given if (String.IsNullOrEmpty(resourcePath) == false) { _testFileReader.LoadFile(resourcePath); testVariables = _testFileReader.GetVariables(); } _testFileReader.LoadFile(path); _assembly = Assembly.Load(_testFileReader.GetLibraryName()); testVariables = testVariables.Concat(_testFileReader.GetVariables()).ToDictionary(x => x.Key, x => x.Value); _setups = _testFileReader.GetSetup(); _testSteps = _testFileReader.GetTestSteps(); _teardowns = _testFileReader.GetTeardown(); _customSteps = _testFileReader.GetKeywords(); _dataSets = _testFileReader.GetDataSets(); // insert the variables into the datastore to be accessed by steps foreach (var pair in testVariables) { var converted = ConvertVariableTokensToValues(pair.Value); DataStore.Add(pair.Key, converted); } // confirm all the required steps are defined var allSteps = GetAvailableTestSteps(); allSteps.AddRange(_customSteps.Select(k => k.Keyword)); allSteps = allSteps.Select(s => Regex.Replace(s, inlineParameterRegex, "'*'")).ToList(); var missingSteps = _setups.Select(t => { return(new TestStep() { Keyword = Regex.Replace(t.Keyword, inlineParameterRegex, "'*'") }); }).Where(s => allSteps.Contains(s.Keyword) == false).ToList(); missingSteps.AddRange(_teardowns.Select(t => { return(new TestStep() { Keyword = Regex.Replace(t.Keyword, inlineParameterRegex, "'*'") }); }).Where(s => allSteps.Contains(s.Keyword) == false).ToList()); missingSteps.AddRange(_testSteps.Select(t => { return(new TestStep() { Keyword = Regex.Replace(t.Keyword, inlineParameterRegex, "'*'") }); }).Where(s => allSteps.Contains(s.Keyword) == false).ToList()); if (missingSteps.Count > 0) { Console.WriteLine("Unable to exeucte the test case."); Console.WriteLine("The following steps do not have definintions:\n" + string.Join("\n", missingSteps.Select(s => s.Keyword))); return(false); } return(true); }
public AbstractTestFileReader([NotNull] ITestFileReader adaptee) { this.adaptee = adaptee; }