public static void MergeACoupleProteins() { ModificationMotif.TryGetMotif("A", out ModificationMotif motif); Protein p = new Protein( "ASEQUENCE", "id", isContaminant: false, isDecoy: false, name: "name", fullName: "full_name", geneNames: new List <Tuple <string, string> > { new Tuple <string, string>("gene", "name") }, databaseReferences: new List <DatabaseReference> { new DatabaseReference("ref", "id", new List <Tuple <string, string> > { new Tuple <string, string>("type", "property") }) }, sequenceVariations: new List <SequenceVariation> { new SequenceVariation(1, 2, "A", "B", "var") }, proteolysisProducts: new List <ProteolysisProduct> { new ProteolysisProduct(1, 2, "prod") }, oneBasedModifications: new Dictionary <int, List <Modification> > { { 1, new List <Modification> { new Modification("mod", null, "type", null, motif, "Anywhere.", null, 1, null, null, null, null, null, null) } } } ); Protein p2 = new Protein( "ASEQUENCE", "id", isContaminant: false, isDecoy: false, name: "name", fullName: "full_name", geneNames: new List <Tuple <string, string> > { new Tuple <string, string>("gene", "name") }, databaseReferences: new List <DatabaseReference> { new DatabaseReference("ref", "id", new List <Tuple <string, string> > { new Tuple <string, string>("type", "property") }) }, sequenceVariations: new List <SequenceVariation> { new SequenceVariation(1, 2, "A", "B", "var") }, proteolysisProducts: new List <ProteolysisProduct> { new ProteolysisProduct(1, 2, "prod") }, oneBasedModifications: new Dictionary <int, List <Modification> > { { 1, new List <Modification> { new Modification("mod", null, "type", null, motif, "Anywhere.", null, 10, null, null, null, null, null, null) } } } ); List <Protein> merged = ProteinDbLoader.MergeProteins(new List <Protein> { p, p2 }).ToList(); Assert.AreEqual(1, merged.Count); Assert.AreEqual(1, merged.First().DatabaseReferences.Count()); Assert.AreEqual(1, merged.First().GeneNames.Count()); Assert.AreEqual(1, merged.First().SequenceVariations.Count()); Assert.AreEqual(1, merged.First().ProteolysisProducts.Count()); Assert.AreNotEqual(p.OneBasedPossibleLocalizedModifications.First().Value.First(), p2.OneBasedPossibleLocalizedModifications.First().Value.First()); Assert.AreEqual(1, merged.First().OneBasedPossibleLocalizedModifications.Count()); Assert.AreEqual(2, merged.First().OneBasedPossibleLocalizedModifications.First().Value.Count); }