public void Parse_ShouldAssumeParsingAmbiguousSequenceAsNucleicAcidSequence() { const string nucleicAcidSequenceString = "ABCD"; IActualSequence sequenceData = ActualSequenceParser.Parse(nucleicAcidSequenceString); Assert.IsNotNull(sequenceData); Assert.IsInstanceOfType(sequenceData, typeof(NucleicAcidSequence)); var nucelicAcidSequenceData = (NucleicAcidSequence)sequenceData; Assert.AreEqual(nucleicAcidSequenceString, nucelicAcidSequenceData.Characters); }
public void Parse_ShouldParseAminoAcidSequence() { const string aminoAcidSequenceString = "ABCZ"; IActualSequence sequenceData = ActualSequenceParser.Parse(aminoAcidSequenceString); Assert.IsNotNull(sequenceData); Assert.IsInstanceOfType(sequenceData, typeof(AminoAcidSequence)); var aminoAcidSequenceData = (AminoAcidSequence)sequenceData; Assert.AreEqual(aminoAcidSequenceString, aminoAcidSequenceData.Characters); }
private static Sequence ParseBase(IEnumerable <string> lines) { try { IEnumerable <string> nonBlankLines = lines.Where(line => !string.IsNullOrWhiteSpace(line)); Header header = Header.Parse(nonBlankLines.First()); IActualSequence sequenceData = ActualSequenceParser.Parse(nonBlankLines.Skip(1)); return(new Sequence(header, sequenceData)); } catch (FormatException ex) { throw new FormatException("The collection of sequence lines are not in the correct format.", ex); } }
public void Parse_ShouldRejectAllWhitespaceText() { _ = ActualSequenceParser.Parse(" "); }
public void Parse_ShouldRejectNullLinesCollection() { _ = ActualSequenceParser.Parse((IEnumerable <string>)null); }
public void Parse_ShouldRejectNullText() { _ = ActualSequenceParser.Parse((string)null); }