コード例 #1
0
ファイル: AnnotatorTests.cs プロジェクト: shannonnana/Nirvana
        public void Annotate_mito_GRCh37()
        {
            var position = new Mock <IPosition>();

            position.SetupGet(x => x.Variants).Returns(GetVariants);
            position.SetupGet(x => x.Chromosome).Returns(ChromosomeUtilities.ChrM);

            var csProvider = new Mock <IAnnotationProvider>();

            csProvider.SetupGet(x => x.Assembly).Returns(GenomeAssembly.GRCh37);
            csProvider.Setup(x => x.Annotate(It.IsAny <IAnnotatedPosition>())).
            Callback((IAnnotatedPosition x) => { x.CytogeneticBand = "testCytoBand"; });

            var taProvider = new Mock <IAnnotationProvider>();

            taProvider.SetupGet(x => x.Assembly).Returns(GenomeAssembly.GRCh37);
            taProvider.Setup(x => x.Annotate(It.IsAny <IAnnotatedPosition>())).Callback((IAnnotatedPosition x) => { });//do nothing

            var annotator = new Annotator(taProvider.Object, null, null, csProvider.Object, null, null);

            annotator.EnableMitochondrialAnnotation();

            var annotatedPosition = annotator.Annotate(position.Object);

            Assert.NotNull(annotatedPosition.CytogeneticBand);
        }