|
- using System;
- using Microsoft.VisualStudio.TestTools.UnitTesting;
- using Shadowsocks.Controller;
-
- namespace test
- {
- [TestClass]
- public class UnitTest
- {
- [TestMethod]
- public void TestCompareVersion()
- {
- Assert.IsTrue(UpdateChecker.CompareVersion("2.3.1.0", "2.3.1") == 0);
- Assert.IsTrue(UpdateChecker.CompareVersion("1.2", "1.3") < 0);
- Assert.IsTrue(UpdateChecker.CompareVersion("1.3", "1.2") > 0);
- Assert.IsTrue(UpdateChecker.CompareVersion("1.3", "1.3") == 0);
- Assert.IsTrue(UpdateChecker.CompareVersion("1.2.1", "1.2") > 0);
- Assert.IsTrue(UpdateChecker.CompareVersion("2.3.1", "2.4") < 0);
- Assert.IsTrue(UpdateChecker.CompareVersion("1.3.2", "1.3.1") > 0);
- }
- }
- }
|