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); }
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); }
/// <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)); }
public void GetVersionLabel_WhenAssemblyIsNull_Throws() { Assert.Throws <ArgumentNullException>(() => VersionPolicy.GetVersionLabel((Assembly)null)); }
private void DisplayVersion() { string versionLabel = VersionPolicy.GetVersionLabel(Assembly.GetExecutingAssembly()); Log(Level.Info, String.Format(Resources.TaskNameAndVersion, versionLabel)); }