markus / MarkusAutoUpdate / src / NetSparkle.Tests / UtilitiesTests.cs @ 299f2c11
이력 | 보기 | 이력해설 | 다운로드 (2.95 KB)
1 | 3276cb1c | taeseongkim | using NetSparkleUpdater.AssemblyAccessors; |
---|---|---|---|
2 | using System; |
||
3 | d8f5045e | taeseongkim | using Xunit; |
4 | |||
5 | namespace NetSparkleUnitTests |
||
6 | { |
||
7 | public class UtilitiesTests |
||
8 | { |
||
9 | [Fact] |
||
10 | public void TestGetVersionString() |
||
11 | { |
||
12 | var versionString = NetSparkleUpdater.Utilities.GetVersionString(new Version(1, 0, 0, 0)); |
||
13 | Assert.Equal("1.0", versionString); |
||
14 | versionString = NetSparkleUpdater.Utilities.GetVersionString(new Version(0, 1, 0, 0)); |
||
15 | Assert.Equal("0.1", versionString); |
||
16 | versionString = NetSparkleUpdater.Utilities.GetVersionString(new Version(1, 1, 0, 0)); |
||
17 | Assert.Equal("1.1", versionString); |
||
18 | versionString = NetSparkleUpdater.Utilities.GetVersionString(new Version(0, 0, 1, 0)); |
||
19 | Assert.Equal("0.0.1", versionString); |
||
20 | versionString = NetSparkleUpdater.Utilities.GetVersionString(new Version(1, 1, 1, 1)); |
||
21 | Assert.Equal("1.1.1.1", versionString); |
||
22 | versionString = NetSparkleUpdater.Utilities.GetVersionString(new Version(1, 0, 0, 1)); |
||
23 | Assert.Equal("1.0.0.1", versionString); |
||
24 | versionString = NetSparkleUpdater.Utilities.GetVersionString(new Version(1, 0, 1, 0)); |
||
25 | Assert.Equal("1.0.1", versionString); |
||
26 | versionString = NetSparkleUpdater.Utilities.GetVersionString(new Version(0, 0, 0, 1)); |
||
27 | Assert.Equal("0.0.0.1", versionString); |
||
28 | } |
||
29 | |||
30 | [Fact] |
||
31 | public void TestGetAbsoluteURL() |
||
32 | { |
||
33 | var abosluteURL = NetSparkleUpdater.Utilities.GetAbsoluteURL("https://example.com/program.exe", "https://example.com/appcast.xml"); |
||
34 | Assert.Equal("https://example.com/program.exe", abosluteURL.ToString()); |
||
35 | abosluteURL = NetSparkleUpdater.Utilities.GetAbsoluteURL("program.exe", "https://example.com/appcast.xml"); |
||
36 | Assert.Equal("https://example.com/program.exe", abosluteURL.ToString()); |
||
37 | abosluteURL = NetSparkleUpdater.Utilities.GetAbsoluteURL("program.exe", "https://example.com/subfolder/appcast.xml"); |
||
38 | Assert.Equal("https://example.com/subfolder/program.exe", abosluteURL.ToString()); |
||
39 | abosluteURL = NetSparkleUpdater.Utilities.GetAbsoluteURL("../program.exe", "https://example.com/subfolder/appcast.xml"); |
||
40 | Assert.Equal("https://example.com/program.exe", abosluteURL.ToString()); |
||
41 | abosluteURL = NetSparkleUpdater.Utilities.GetAbsoluteURL("./program.exe", "https://example.com/subfolder/appcast.xml"); |
||
42 | Assert.Equal("https://example.com/subfolder/program.exe", abosluteURL.ToString()); |
||
43 | } |
||
44 | 3276cb1c | taeseongkim | |
45 | [Fact] |
||
46 | public void AssemblyReflectionAccessorTest() |
||
47 | { |
||
48 | //AssemblyReflectionAccessor assemblyReflectionAccessor = new AssemblyReflectionAccessor(@"D:\Source\Repos\MARKUS\publish\AppCast_DIG\5.4.1.0\Markus_5.4.1.0\KCOM.exe"); |
||
49 | AssemblyReflectionAccessor assemblyReflectionAccessor = new AssemblyReflectionAccessor(@"C:\Program Files\Doftech\Markus\KCOM.exe"); |
||
50 | } |
||
51 | |||
52 | d8f5045e | taeseongkim | } |
53 | } |