public void GetAssemblyInfo() { Assembly assembly = Assembly.GetExecutingAssembly(); AssemblyUtils.AssemblyInfo assemblyInfo = AssemblyUtils.GetAssemblyInfo(assembly); Assert.AreEqual("DelftTools.Tests", assemblyInfo.Title); }
/// <summary> /// Creates a new instance of <see cref="SettingsHelper"/>. /// </summary> protected SettingsHelper() { // set defaults based on executing assembly AssemblyUtils.AssemblyInfo info = AssemblyUtils.GetExecutingAssemblyInfo(); ApplicationName = info.Product; ApplicationVersion = info.Version; }
public void GetAssemblyInfo_ForThisTestProjectAssembly_ReturnAssemblyInfoWithExpectedValues() { // Setup var assembly = Assembly.GetAssembly(GetType()); // Call AssemblyUtils.AssemblyInfo assemblyInfo = AssemblyUtils.GetAssemblyInfo(assembly); // Assert Assert.AreEqual("Deltares", assemblyInfo.Company); Assert.AreEqual("Copyright © Deltares 2022", assemblyInfo.Copyright); Assert.AreEqual("Core.Common.Util.Test", assemblyInfo.Product); Assert.AreEqual("Core.Common.Util.Test", assemblyInfo.Title); StringAssert.StartsWith("22.2.1.1", assemblyInfo.Version); }
public void GetAssemblyInfo_LocationIsEmpty_ReturnEmptyAssemblyInfo() { // Setup var assemblyWithoutLocation = new MockedAssemblyWithoutLocation(); // Call AssemblyUtils.AssemblyInfo assemblyInfo = AssemblyUtils.GetAssemblyInfo(assemblyWithoutLocation); // Assert Assert.IsNull(assemblyInfo.Company); Assert.IsNull(assemblyInfo.Copyright); Assert.IsNull(assemblyInfo.Description); Assert.IsNull(assemblyInfo.Product); Assert.IsNull(assemblyInfo.Title); Assert.IsNull(assemblyInfo.Version); }
public void GetExecutingAssemblyInfo_ReturnAssemblyInfoForAssemblyUtilsAssembly() { // Setup var assembly = Assembly.GetAssembly(typeof(AssemblyUtils)); AssemblyUtils.AssemblyInfo assemblyInfo = AssemblyUtils.GetAssemblyInfo(assembly); // Call AssemblyUtils.AssemblyInfo executingAssemblyInfo = AssemblyUtils.GetExecutingAssemblyInfo(); // Assert Assert.AreEqual(assemblyInfo.Company, executingAssemblyInfo.Company); Assert.AreEqual(assemblyInfo.Copyright, executingAssemblyInfo.Copyright); Assert.AreEqual(assemblyInfo.Description, executingAssemblyInfo.Description); Assert.AreEqual(assemblyInfo.Product, executingAssemblyInfo.Product); Assert.AreEqual(assemblyInfo.Title, executingAssemblyInfo.Title); Assert.AreEqual(assemblyInfo.Version, executingAssemblyInfo.Version); }