當前位置: 首頁>>代碼示例>>C#>>正文


C# TestContext.TestOutputPath方法代碼示例

本文整理匯總了C#中Microsoft.VisualStudio.TestTools.UnitTesting.TestContext.TestOutputPath方法的典型用法代碼示例。如果您正苦於以下問題:C# TestContext.TestOutputPath方法的具體用法?C# TestContext.TestOutputPath怎麽用?C# TestContext.TestOutputPath使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Microsoft.VisualStudio.TestTools.UnitTesting.TestContext的用法示例。


在下文中一共展示了TestContext.TestOutputPath方法的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.TestOutputPath方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。