Beispiel #1
0
        public void GetAssemblyInfo()
        {
            Assembly assembly = Assembly.GetExecutingAssembly();

            AssemblyUtils.AssemblyInfo assemblyInfo = AssemblyUtils.GetAssemblyInfo(assembly);
            Assert.AreEqual("DelftTools.Tests", assemblyInfo.Title);
        }
Beispiel #2
0
 /// <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;
 }
Beispiel #3
0
        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);
        }
Beispiel #4
0
        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);
        }
Beispiel #5
0
        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);
        }