public void ValidateSamParserWithDVIscFile() { // Gets the expected sequence from the Xml string filePath = _utilityObj._xmlUtil.GetTextValue( Constants.SAMFileWithRefNode, Constants.FilePathNode); ISequenceAlignmentParser iSeqParser = SequenceAlignmentParsers.FindParserByFile(filePath); if (null != iSeqParser) { IVirtualSequenceAlignmentParser vParserObj = iSeqParser as IVirtualSequenceAlignmentParser; if (null != vParserObj) { vParserObj.EnforceDataVirtualization = true; } else { Assert.Fail("SAM P1 Cases : Could not find the SAM Parser Object."); } string iscFilePath = string.Concat(filePath, ".isc"); iSeqParser.Parse(filePath); if (File.Exists(iscFilePath)) { Console.WriteLine( "SAM P1 Cases : DV enabled as expected and isc file created successfully."); ApplicationLog.WriteLine( "SAM P1 Cases : DV enabled as expected and isc file created successfully."); } else { Assert.Fail("SAM P1 Cases : DV not enabled as expected."); } } else { Assert.Fail("SAM P1 Cases : Could not find the SAM file"); } }
/// <summary> /// Validates general Sequence Parser. /// </summary> /// <param name="nodeName">xml node name.</param> /// <param name="IsParser">IsParser is true if testcases is validating Parsers, /// false if formatter validation</param> void ValidateSequenceFileParser(string nodeName, bool IsParser) { // Gets the expected sequence from the Xml string[] filePaths = _utilityObj._xmlUtil.GetTextValues(nodeName, Constants.FilePathsNode); string parserDescription = _utilityObj._xmlUtil.GetTextValue(nodeName, Constants.DescriptionNode); string parserName = _utilityObj._xmlUtil.GetTextValue(nodeName, Constants.ParserNameNode); string fileTypes = _utilityObj._xmlUtil.GetTextValue(nodeName, Constants.FileTypesNode); // Get a default parser for the file types. for (int i = 0; i < filePaths.Length; i++) { if (IsParser) { ISequenceAlignmentParser parser = SequenceAlignmentParsers.FindParserByFile(filePaths[i]); string description = parser.Description.Replace("\r", "").Replace("\n", ""); // Validate parser name, description and the file type supported by parser. Assert.AreEqual(parserName, parser.Name); Assert.AreEqual(parserDescription, description); Assert.AreEqual(fileTypes, parser.FileTypes); } else { ISequenceAlignmentFormatter formatter = SequenceAlignmentFormatters.FindFormatterByFile(filePaths[i]); Console.WriteLine(filePaths[i]); Console.WriteLine(formatter.Description); string description = formatter.Description.Replace("\r", "").Replace("\n", ""); // Validate parser name, description and the file type supported by parser. Assert.AreEqual(parserName, formatter.Name); Assert.AreEqual(parserDescription, description); Assert.AreEqual(fileTypes, formatter.FileTypes); } } Console.WriteLine(string.Format((IFormatProvider)null, "SequenceAlignmentParser : Type of the parser is validated successfully")); ApplicationLog.WriteLine("Type of the parser is validated successfully"); }