public void ValidateDeltaAlignmentToString() { ISequence refSeq = new Sequence(Alphabets.DNA, "ATCGGGGGGGGAAAAAAATTTTCCCCGGGGG"); ISequence qrySeq = new Sequence(Alphabets.DNA, "GGGGG"); var delta = new DeltaAlignment(refSeq, qrySeq) {FirstSequenceEnd = 21, SecondSequenceEnd = 20}; string actualString = delta.ToString(); string expectedString = this.utilityObj.xmlUtil.GetTextValue(Constants.ToStringNodeName, Constants.DeltaAlignmentExpectedNode); Assert.AreEqual(expectedString, actualString); // Gets the expected sequence from the Xml List<ISequence> seqsList; string filePath = this.utilityObj.xmlUtil.GetTextValue(Constants.SimpleFastaNodeName, Constants.FilePathNode); using (var reader = File.OpenRead(filePath)) { var parser = new FastAParser(); { parser.Alphabet = Alphabets.Protein; seqsList = parser.Parse(reader).ToList(); } } delta = new DeltaAlignment(seqsList[0], qrySeq) {FirstSequenceEnd = 21, SecondSequenceStart = 20, QueryDirection = Cluster.ReverseDirection}; actualString = delta.ToString(); expectedString = this.utilityObj.xmlUtil.GetTextValue(Constants.ToStringNodeName, Constants.DeltaAlignmentExpected2Node); Assert.AreEqual(expectedString, actualString); }
public void TestDeltaAlignmentToString() { ISequence refSeq = new Sequence(Alphabets.DNA, "ATCGGGGGGGGAAAAAAATTTTCCCCGGGGG"); ISequence qrySeq = new Sequence(Alphabets.DNA, "GGGGG"); DeltaAlignment delta = new DeltaAlignment(refSeq, qrySeq); delta.FirstSequenceEnd = 21; delta.SecondSequenceEnd = 20; string actualString = delta.ToString(); string expectedString = "Ref ID= Query Id= Ref start=0 Ref End=21 Query start=0 Query End=20, Direction=FORWARD"; Assert.AreEqual(actualString, expectedString); }