/// <summary> /// Private constructor for clone method. /// </summary> /// <param name="other">Other MiscDifference instance.</param> private MiscDifference(MiscDifference other) : base(other) { }
/// <summary> /// Validate GenBank Misc difference feature qualifiers. /// </summary> /// <param name="nodeName">xml node name.</param> private void ValidateGenBankMiscDiffFeatureQualifiers(string nodeName) { // Get Values from XML node. string filePath = utilityObj.xmlUtil.GetTextValue( nodeName, Constants.FilePathNode); string expectedMiscDiffCount = utilityObj.xmlUtil.GetTextValue( nodeName, Constants.MiscDiffCount); string expectedGeneSymbol = utilityObj.xmlUtil.GetTextValue( nodeName, Constants.GeneSymbol); // Parse a GenBank file. ISequenceParser parserObj = new GenBankParser(); { IEnumerable<ISequence> seqList = parserObj.Parse(filePath); // Validate Protein feature all qualifiers. var metadata = (GenBankMetadata) seqList.ElementAt(1).Metadata[Constants.GenBank]; List<MiscDifference> miscDifferenceFeatureList = metadata.Features.MiscDifferences; Assert.AreEqual(miscDifferenceFeatureList.Count.ToString((IFormatProvider) null), expectedMiscDiffCount); Assert.AreEqual(miscDifferenceFeatureList[0].GeneSymbol, expectedGeneSymbol); Assert.IsTrue(string.IsNullOrEmpty(miscDifferenceFeatureList[0].Allele)); Assert.IsFalse(string.IsNullOrEmpty(miscDifferenceFeatureList[0].Citation.ToString())); Assert.IsFalse(string.IsNullOrEmpty(miscDifferenceFeatureList[0].Experiment.ToString())); Assert.IsFalse(string.IsNullOrEmpty(miscDifferenceFeatureList[0].GeneSynonym.ToString())); Assert.IsTrue(string.IsNullOrEmpty(miscDifferenceFeatureList[0].GenomicMapPosition)); Assert.IsFalse(string.IsNullOrEmpty(miscDifferenceFeatureList[0].Inference.ToString())); Assert.IsTrue(string.IsNullOrEmpty(miscDifferenceFeatureList[0].Label)); Assert.IsFalse(string.IsNullOrEmpty(miscDifferenceFeatureList[0].OldLocusTag.ToString())); Assert.IsTrue(string.IsNullOrEmpty(miscDifferenceFeatureList[0].StandardName)); Assert.IsTrue(string.IsNullOrEmpty(miscDifferenceFeatureList[0].Replace)); Assert.IsFalse(string.IsNullOrEmpty(miscDifferenceFeatureList[0].Phenotype.ToString())); Assert.IsFalse(string.IsNullOrEmpty(miscDifferenceFeatureList[0].OldLocusTag.ToString())); Assert.IsFalse(string.IsNullOrEmpty(miscDifferenceFeatureList[0].LocusTag.ToString())); Assert.IsFalse(string.IsNullOrEmpty(miscDifferenceFeatureList[0].Compare.ToString())); Assert.IsFalse(string.IsNullOrEmpty(miscDifferenceFeatureList[0].DatabaseCrossReference.ToString())); Assert.IsTrue(string.IsNullOrEmpty(miscDifferenceFeatureList[0].ClonedFrom)); // Create a new MiscDiff feature using constructor. var miscDiffWithLoc = new MiscDifference( metadata.Features.MiscDifferences[0].Location); // Set and validate qualifiers. miscDiffWithLoc.GeneSymbol = expectedGeneSymbol; Assert.AreEqual(miscDiffWithLoc.GeneSymbol, expectedGeneSymbol); // Log VSTest GUI. ApplicationLog.WriteLine( "GenBank Features P1: Successfully validated the GenBank Features"); } }