using System;
using System.Collections.Generic;
using System.Text;
using NUnit.Framework;
using System.IO;
using System.Reflection;
namespace Systin.Library.UnitTests{
/// <summary>
/// Write the summary for the test class here.
/// </summary>
[TestFixture]
public class TestClass
{
private static string LanguageLibraryName = "LanguageLibrary.dll";
[Test]
[ExpectedException(typeof(ArgumentNullException))]
public void LoadDllWithANullObjectResultsInArgumentNullException()
{
DllLoader.LoadDll(null);
}
[Test]
public void LoadDllContainingLanguageDriverLibrary(){
String pathToLanguageLibrary = Util.GetPathToLanguageLibrary(LanguageLibraryName);
FileInfo file = new FileInfo(pathToLanguageLibrary);
Assembly assembly = Assembly.LoadFile(pathToLanguageLibrary);
DllLoader loader = DllLoader.LoadDll(file);
Assert.AreEqual(loader.FileHandle.ToString(), file.ToString(), "File Handle Objects do not match");
Assert.AreEqual(loader.FileName, file.Name, "File Handle Objects do not match");
Assert.AreEqual(loader.LanguageAssembly, assembly, "File Handle Objects do not match");
}
}
}
|