public void ValidateDnaDerivedSequenceGetReverseComplemented() { // 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 reverseCompObj = utilityObj.xmlUtil.GetTextValue( Constants.DnaDerivedSequenceNode, Constants.ReverseComplement); 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(reverseCompObj, new string(derSequence.GetReverseComplementedSequence().Select(a => (char)a).ToArray())); Console.WriteLine( "DerivedSequenceBvtTestCases:Validation of GetReverseComplementedSequence() method of derived sequence completed successfully"); ApplicationLog.WriteLine( "DerivedSequenceBvtTestCases:Validation of GetReverseComplementedSequence() method of derived sequence completed successfully"); }
public void TestGetReverseComplementedSequence() { const string sequence = "ATGCC"; const string expectedSequence = "GGCAT"; ISequence orignalSequence = new Sequence(Alphabets.DNA, sequence); DerivedSequence deriveSequence = new DerivedSequence(orignalSequence, false, false); string actualSequence = new string(deriveSequence.GetReverseComplementedSequence().Select(a => (char)a).ToArray()); Assert.AreEqual(expectedSequence, actualSequence); }
public void TestGetReverseComplementedSequence() { const string sequence = "ATGCC"; const string expectedSequence = "GGCAT"; ISequence orignalSequence = new Sequence(Alphabets.DNA, sequence); DerivedSequence deriveSequence = new DerivedSequence(orignalSequence, false, false); string actualSequence = new string(deriveSequence.GetReverseComplementedSequence().Select(a => (char)a).ToArray()); Assert.AreEqual(expectedSequence, actualSequence); }