public void ValidateDnaDerivedSequenceProperties() { // Get input and expected values from xml string expectedSequence = utilityObj.xmlUtil.GetTextValue( Constants.DnaDerivedSequenceNode, Constants.ExpectedSequence); string alphabetName = utilityObj.xmlUtil.GetTextValue( Constants.DnaDerivedSequenceNode, Constants.AlphabetNameNode); string derivedSequence = utilityObj.xmlUtil.GetTextValue( Constants.DnaDerivedSequenceNode, Constants.DerivedSequence); IAlphabet alphabet = Utility.GetAlphabet(alphabetName); // Create derived Sequence DerivedSequence derSequence = CreateDerivedSequence( alphabet, expectedSequence); // Validate properties of derived Sequence. Assert.AreEqual(derivedSequence, new string(derSequence.Select(a => (char)a).ToArray())); Assert.AreEqual(alphabet, derSequence.Alphabet); Assert.IsNotNull(derSequence.Metadata); Console.WriteLine( "DerivedSequenceBvtTestCases:Validation of properties of derived sequence completed successfully"); ApplicationLog.WriteLine( "DerivedSequenceBvtTestCases:Validation of properties of derived sequence completed successfully"); }
public void ValidateDnaDerivedSequenceGetComplemented() { // Get input and expected values from xml string expectedSequence = utilityObj.xmlUtil.GetTextValue( Constants.DnaDerivedSequenceNode, Constants.ExpectedSequence); string alphabetName = utilityObj.xmlUtil.GetTextValue( Constants.DnaDerivedSequenceNode, Constants.AlphabetNameNode); string complementObj = utilityObj.xmlUtil.GetTextValue( Constants.DnaDerivedSequenceNode, Constants.Complement); string derivedSequence = utilityObj.xmlUtil.GetTextValue( Constants.DnaDerivedSequenceNode, Constants.DerivedSequence); IAlphabet alphabet = Utility.GetAlphabet(alphabetName); // Create derived Sequence DerivedSequence derSequence = CreateDerivedSequence( alphabet, expectedSequence); // Validate IndexOf() derived Sequence. Assert.AreEqual(derivedSequence, new string(derSequence.Select(a => (char)a).ToArray())); Assert.AreEqual(complementObj, new string(derSequence.GetComplementedSequence().Select(a => (char)a).ToArray())); Console.WriteLine( "DerivedSequenceBvtTestCases:Validation of GetComplementedSequence() method of derived sequence completed successfully"); ApplicationLog.WriteLine( "DerivedSequenceBvtTestCases:Validation of GetComplementedSequence() method of derived sequence completed successfully"); }
public void ValidateDnaDerivedSequenceGetSubSequence() { // Get input and expected values from xml string expectedSequence = utilityObj.xmlUtil.GetTextValue( Constants.DnaDerivedSequenceNode, Constants.ExpectedSequence); string alphabetName = utilityObj.xmlUtil.GetTextValue( Constants.DnaDerivedSequenceNode, Constants.AlphabetNameNode); string rangeObj = utilityObj.xmlUtil.GetTextValue( Constants.DnaDerivedSequenceNode, Constants.Range); string expSubSequence = utilityObj.xmlUtil.GetTextValue( Constants.DnaDerivedSequenceNode, Constants.RangeSequence); string derivedSequence = utilityObj.xmlUtil.GetTextValue( Constants.DnaDerivedSequenceNode, Constants.DerivedSequence); IAlphabet alphabet = Utility.GetAlphabet(alphabetName); // Create derived Sequence DerivedSequence derSequence = CreateDerivedSequence( alphabet, expectedSequence); string[] ranges = rangeObj.Split(','); // Validate IndexOf() derived Sequence. Assert.AreEqual(derivedSequence, new string(derSequence.Select(a => (char)a).ToArray())); Assert.AreEqual(expSubSequence, new string(derSequence.GetSubSequence(long.Parse(ranges[0], (IFormatProvider)null), long.Parse(ranges[1], (IFormatProvider)null)).Select(a => (char)a).ToArray())); Console.WriteLine( "DerivedSequenceBvtTestCases:Validation of GetSubSequence() method of derived sequence completed successfully"); ApplicationLog.WriteLine( "DerivedSequenceBvtTestCases:Validation of GetSubSequence() method of derived sequence completed successfully"); }
public void ValidateProteinDerivedSequence() { // Get input and expected values from xml string expectedSequence = this.utilityObj.xmlUtil.GetTextValue( Constants.ProteinDerivedSequenceNode, Constants.ExpectedSequence); string alphabetName = this.utilityObj.xmlUtil.GetTextValue( Constants.ProteinDerivedSequenceNode, Constants.AlphabetNameNode); IAlphabet alphabet = Utility.GetAlphabet(alphabetName); // Create derived Sequence DerivedSequence derSequence = CreateDerivedSequence( alphabet, expectedSequence); // Validate derived Sequence. Assert.AreEqual(expectedSequence, new string(derSequence.Select(a => (char)a).ToArray())); ApplicationLog.WriteLine( "DerivedSequenceBvtTestCases:Validation of derived sequence completed successfully"); }