/// <summary> /// Private constructor for clone method. /// </summary> /// <param name="other">Other Terminator instance.</param> private Terminator(Terminator other) : base(other) { }
public void ValidateGenBankTerminatorFeatureQualifiers() { // Get Values from XML node. string filePath = utilityObj.xmlUtil.GetTextValue( Constants.GenBankTerminatorNode, Constants.FilePathNode); string terminatorLocation = utilityObj.xmlUtil.GetTextValue( Constants.GenBankTerminatorNode, Constants.Location); string featureCount = utilityObj.xmlUtil.GetTextValue( Constants.GenBankTerminatorNode, Constants.QualifierCount); string geneSymbol = utilityObj.xmlUtil.GetTextValue( Constants.GenBankTerminatorNode, Constants.GeneSymbol); // Parse a GenBank file. ISequenceParser parserObj = new GenBankParser(); { IEnumerable<ISequence> seqList = parserObj.Parse(filePath); var locBuilder = new LocationBuilder(); var metadata = (GenBankMetadata) seqList.ElementAt(0).Metadata[Constants.GenBank]; List<Terminator> terminatorList = metadata.Features.Terminators; // Create a clone of Terminator feature feature. Terminator cloneTerminator = terminatorList[0].Clone(); Assert.AreEqual(terminatorList.Count.ToString((IFormatProvider) null), featureCount); Assert.AreEqual(cloneTerminator.GeneSymbol, geneSymbol); Assert.IsFalse(string.IsNullOrEmpty(cloneTerminator.DatabaseCrossReference.ToString())); Assert.IsTrue(string.IsNullOrEmpty(terminatorList[0].Allele)); Assert.IsFalse(string.IsNullOrEmpty(terminatorList[0].Citation.ToString())); Assert.IsFalse(string.IsNullOrEmpty(terminatorList[0].Experiment.ToString())); Assert.IsTrue(string.IsNullOrEmpty(terminatorList[0].GenomicMapPosition)); Assert.IsFalse(string.IsNullOrEmpty(terminatorList[0].GeneSynonym.ToString())); Assert.IsFalse(string.IsNullOrEmpty(terminatorList[0].Inference.ToString())); Assert.IsTrue(string.IsNullOrEmpty(terminatorList[0].Label)); Assert.AreEqual(locBuilder.GetLocationString( metadata.Features.Terminators[0].Location), terminatorLocation); Assert.IsFalse(string.IsNullOrEmpty(terminatorList[0].Note.ToString())); Assert.IsFalse(string.IsNullOrEmpty(terminatorList[0].OldLocusTag.ToString())); Assert.IsFalse(string.IsNullOrEmpty(terminatorList[0].LocusTag.ToString())); Assert.IsTrue(string.IsNullOrEmpty(terminatorList[0].StandardName)); // Create a new Terminator signal and validate the same. var terminator = new Terminator(terminatorLocation); var terminatorWithILoc = new Terminator( metadata.Features.Terminators[0].Location); // Set qualifiers and validate them. terminator.GeneSymbol = geneSymbol; terminatorWithILoc.GeneSymbol = geneSymbol; Assert.AreEqual(terminator.GeneSymbol, geneSymbol); Assert.AreEqual(terminatorWithILoc.GeneSymbol, geneSymbol); // Log VSTest GUI. ApplicationLog.WriteLine( "GenBank Features P1: Successfully validated the GenBank Features"); } }