public void GetAssemblyFileVersion_Unknown() { var asm = new AssemblyMock(); var version = HostStatus.GetAssemblyFileVersion(asm); Assert.Equal("Unknown", version); }
public void GetAssemblyFileVersion_ReturnsVersion() { var fileAttr = new AssemblyFileVersionAttribute("1.2.3.4"); var asmMock = new Mock <AssemblyMock>(); asmMock.Setup(a => a.GetCustomAttributes(typeof(AssemblyFileVersionAttribute), true)) .Returns(new Attribute[] { fileAttr }) .Verifiable(); var version = HostStatus.GetAssemblyFileVersion(asmMock.Object); Assert.Equal("1.2.3.4", version); asmMock.Verify(); }