当前位置: 首页>>代码示例>>C#>>正文


C# TestContext.SetTestOutputSubdirectory方法代码示例

本文整理汇总了C#中Microsoft.VisualStudio.TestTools.UnitTesting.TestContext.SetTestOutputSubdirectory方法的典型用法代码示例。如果您正苦于以下问题:C# TestContext.SetTestOutputSubdirectory方法的具体用法?C# TestContext.SetTestOutputSubdirectory怎么用?C# TestContext.SetTestOutputSubdirectory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Microsoft.VisualStudio.TestTools.UnitTesting.TestContext的用法示例。


在下文中一共展示了TestContext.SetTestOutputSubdirectory方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ClassInitialize

        public static void ClassInitialize (TestContext testContext)
        {
            testContext.SetTestOutputSubdirectory(testContext.FullyQualifiedTestClassName + "/" + testContext.TestName);
            Directory.CreateDirectory(testContext.TestOutputPath());
            string testModelFilepath = testContext.TestOutputPath("../testModel.idpDB");
            var sessionFactory = SessionFactoryFactory.CreateSessionFactory(testModelFilepath, new SessionFactoryConfig { CreateSchema = true });
            var session = sessionFactory.OpenSession();

            CreateTestProteins(session, testProteinSequences);
            CreateTestData(session, testPsmSummary);
            AddSubsetPeakData(session);

            var qonverterSettings1 = new QonverterSettings()
            {
                Analysis = session.UniqueResult<Analysis>(o => o.Software.Name == "Engine 1"),
                QonverterMethod = Qonverter.QonverterMethod.StaticWeighted,
                DecoyPrefix = "quiRKy",
                RerankMatches = true,
                ScoreInfoByName = new Dictionary<string, Qonverter.Settings.ScoreInfo>()
                {
                    {"score1", new Qonverter.Settings.ScoreInfo()
                                {
                                    Weight = 1,
                                    Order = Qonverter.Settings.Order.Ascending,
                                    NormalizationMethod = Qonverter.Settings.NormalizationMethod.Linear
                                }},
                    {"score2", new Qonverter.Settings.ScoreInfo()
                                {
                                    Weight = 42,
                                    Order = Qonverter.Settings.Order.Descending,
                                    NormalizationMethod = Qonverter.Settings.NormalizationMethod.Quantile
                                }}
                }
            };

            var qonverterSettings2 = new QonverterSettings()
            {
                Analysis = session.UniqueResult<Analysis>(o => o.Software.Name == "Engine 2"),
                QonverterMethod = Qonverter.QonverterMethod.SVM,
                DecoyPrefix = "___---",
                RerankMatches = false,
                ScoreInfoByName = new Dictionary<string, Qonverter.Settings.ScoreInfo>()
                {
                    {"foo", new Qonverter.Settings.ScoreInfo()
                            {
                                Weight = 7,
                                Order = Qonverter.Settings.Order.Ascending,
                                NormalizationMethod = Qonverter.Settings.NormalizationMethod.Off
                            }},
                    {"bar", new Qonverter.Settings.ScoreInfo()
                            {
                                Weight = 11,
                                Order = Qonverter.Settings.Order.Descending,
                                NormalizationMethod = Qonverter.Settings.NormalizationMethod.Off
                            }}
                }
            };

            session.Save(qonverterSettings1);
            session.Save(qonverterSettings2);
            session.Flush();
                
            session.Close();
            sessionFactory.Close();
        }
开发者ID:lgatto,项目名称:proteowizard,代码行数:65,代码来源:TestModel.cs


注:本文中的Microsoft.VisualStudio.TestTools.UnitTesting.TestContext.SetTestOutputSubdirectory方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。