moved to nunit
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace Katteker.Test
|
||||
{
|
||||
[TestClass]
|
||||
[TestFixture]
|
||||
public class KattekerLibTest
|
||||
{
|
||||
private static readonly string BaseDir = AppDomain.CurrentDomain.BaseDirectory;
|
||||
private static readonly string ExampleFile = Path.Combine(BaseDir, "testdata", "Example.exe");
|
||||
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void Sha1ChecksumOfFile()
|
||||
{
|
||||
var actual = Utility.ComputeFileHash(ExampleFile);
|
||||
@@ -19,7 +19,7 @@ namespace Katteker.Test
|
||||
Assert.AreEqual(expected, actual);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void CheckIfStringIsWebUrl()
|
||||
{
|
||||
const string test1 = "http://TolleUrl.de/Test";
|
||||
@@ -27,13 +27,13 @@ namespace Katteker.Test
|
||||
const string test3 = "C:\\Test";
|
||||
const string test4 = "furz";
|
||||
|
||||
Assert.IsTrue(Utility.IsWebUrl(test1));
|
||||
Assert.IsTrue(Utility.IsWebUrl(test2));
|
||||
Assert.IsFalse(Utility.IsWebUrl(test3));
|
||||
Assert.ThrowsException<UriFormatException>(() => Utility.IsWebUrl(test4));
|
||||
Assert.True(Utility.IsWebUrl(test1));
|
||||
Assert.True(Utility.IsWebUrl(test2));
|
||||
Assert.False(Utility.IsWebUrl(test3));
|
||||
Assert.Throws<UriFormatException>(() => Utility.IsWebUrl(test4));
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void CheckRightAssemblyName()
|
||||
{
|
||||
const string expected = "Example";
|
||||
@@ -41,12 +41,19 @@ namespace Katteker.Test
|
||||
Assert.AreEqual(expected, actual);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void CheckAssemblyVersionStuff()
|
||||
{
|
||||
var expected = new Semver.SemVersion(1, 0, 53);
|
||||
var actual = VersionUtils.GetCurrentVersion(Assembly.LoadFile(ExampleFile));
|
||||
Assert.AreEqual(expected, actual);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestGetLocalAppDataDirectory()
|
||||
{
|
||||
var expected = Utility.GetLocalAppDataDirectory();
|
||||
Assert.IsTrue(expected.Contains("AppData\\Local"));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user