コード例 #1
0
        public void GetVersionLabel_WhenVersionIsProvided_ReturnsFormattedLabel()
        {
            var version = new Version(1, 2, 3, 4);

            string label = VersionPolicy.GetVersionLabel(version);

            Assert.AreEqual("1.2 build 3", label);
        }
コード例 #2
0
        public void GetVersionLabel_WhenAssemblyIsProvided_ReturnsFormattedLabel()
        {
            var assembly = typeof(VersionPolicy).Assembly;
            var version  = VersionPolicy.GetVersionNumber(assembly);

            string label = VersionPolicy.GetVersionLabel(version);

            Assert.AreEqual(string.Format("{0}.{1} build {2}", version.Major, version.Minor, version.Build), label);
        }
コード例 #3
0
        /// <inheritdoc />
        protected override FacadeTestRunState RunImpl(IFacadeTestListener testListener, string assemblyPath, string cref, FacadeOptions facadeOptions)
        {
            string versionLabel = VersionPolicy.GetVersionLabel(Assembly.GetExecutingAssembly());

            testListener.WriteLine(String.Format(Resources.RunnerNameAndVersion + "\n", versionLabel), FacadeCategory.Info);

            switch (facadeOptions.FilterCategoryMode)
            {
            case FacadeFilterCategoryMode.Include:
                testListener.WriteLine(String.Format("Included categories: {0}\n", CombineCategoryNameList(facadeOptions.FilterCategoryNames)), FacadeCategory.Info);
                break;

            case FacadeFilterCategoryMode.Exclude:
                testListener.WriteLine(String.Format("Excluded categories: {0}\n", CombineCategoryNameList(facadeOptions.FilterCategoryNames)), FacadeCategory.Info);
                break;
            }

            EnsureTestRunnerIsCreated();
            return(testRunner.Run(testListener, assemblyPath, cref, facadeOptions));
        }
コード例 #4
0
 public void GetVersionLabel_WhenAssemblyIsNull_Throws()
 {
     Assert.Throws <ArgumentNullException>(() => VersionPolicy.GetVersionLabel((Assembly)null));
 }
コード例 #5
0
ファイル: GallioTask.cs プロジェクト: still-adam-k/mbunit-v3
        private void DisplayVersion()
        {
            string versionLabel = VersionPolicy.GetVersionLabel(Assembly.GetExecutingAssembly());

            Log(Level.Info, String.Format(Resources.TaskNameAndVersion, versionLabel));
        }