public void ValidateSequenceStatisticsToString() { ISequence seq = new Sequence(Alphabets.DNA, "ATCGATCG"); var seqStats = new SequenceStatistics(seq); string actualString = seqStats.ToString(); string expectedString = "A - 2\r\nC - 2\r\nG - 2\r\nT - 2\r\n".Replace("\r\n", System.Environment.NewLine); Assert.AreEqual(actualString, expectedString); // Gets the expected sequence from the Xml List <ISequence> seqsList; IEnumerable <ISequence> sequences = null; string filePath = this.utilityObj.xmlUtil.GetTextValue(Constants.SimpleFastaNodeName, Constants.FilePathNode); using (var reader = File.OpenRead(filePath)) { var parser = new FastAParser(); { parser.Alphabet = Alphabets.Protein; sequences = parser.Parse(reader); //Create a list of sequences. seqsList = sequences.ToList(); } } foreach (ISequence Sequence in seqsList) { seqStats = new SequenceStatistics(Sequence); string seqStatStr = seqStats.ToString(); Assert.IsTrue(seqStatStr.Contains(" - ")); } }
public void TestSequenceStatisticsToString() { ISequence seq = new Sequence(Alphabets.DNA, "ATCGATCG"); SequenceStatistics seqStats = new SequenceStatistics(seq); string actualString = seqStats.ToString(); string expectedString = "A - 2\r\nC - 2\r\nG - 2\r\nT - 2\r\n".Replace("\r\n", Environment.NewLine); Assert.AreEqual(actualString, expectedString); }
public void CreateStatsAndCheckToString() { ISequence sequence = new Sequence(Alphabets.DNA, "ACGT--ACGT--ACGT--"); SequenceStatistics stats = new SequenceStatistics(sequence); string expectedValue = "- - 6\r\nA - 3\r\nC - 3\r\nG - 3\r\nT - 3\r\n".Replace("\r\n", Environment.NewLine); string actualValue = stats.ToString(); Assert.AreEqual(expectedValue, actualValue); }
public void ValidateSequenceStatisticsToString() { ISequence seq = new Sequence(Alphabets.DNA, "ATCGATCG"); var seqStats = new SequenceStatistics(seq); string actualString = seqStats.ToString(); string expectedString = "A - 2\r\nC - 2\r\nG - 2\r\nT - 2\r\n".Replace("\r\n", System.Environment.NewLine); Assert.AreEqual(actualString, expectedString); // Gets the expected sequence from the Xml List<ISequence> seqsList; IEnumerable<ISequence> sequences = null; string filePath = this.utilityObj.xmlUtil.GetTextValue(Constants.SimpleFastaNodeName, Constants.FilePathNode); using (var reader = File.OpenRead(filePath)) { var parser = new FastAParser(); { parser.Alphabet = Alphabets.Protein; sequences = parser.Parse(reader); //Create a list of sequences. seqsList = sequences.ToList(); } } foreach (ISequence Sequence in seqsList) { seqStats = new SequenceStatistics(Sequence); string seqStatStr = seqStats.ToString(); Assert.IsTrue(seqStatStr.Contains(" - ")); } }