1
// ****************************************************************
2
// Copyright 2007, Charlie Poole
3
// This is free software licensed under the NUnit license. You may
4
// obtain a copy of the license at http://nunit.org
5
// ****************************************************************
10
namespace NUnit.Core.Tests
13
public class AssemblyReaderTests
15
private AssemblyReader rdr;
18
public void CreateReader()
20
rdr = new AssemblyReader( this.GetType().Assembly );
24
public void DisposeReader()
33
public void CreateFromPath()
35
string path = AssemblyHelper.GetAssemblyPath(System.Reflection.Assembly.GetAssembly(GetType()));
36
Assert.AreEqual(path, new AssemblyReader(path).AssemblyPath);
40
public void CreateFromAssembly()
42
string path = AssemblyHelper.GetAssemblyPath(System.Reflection.Assembly.GetAssembly(GetType()));
43
Assert.AreEqual(path, rdr.AssemblyPath);
47
public void IsValidPeFile()
49
Assert.IsTrue( rdr.IsValidPeFile );
53
public void IsValidPeFile_Fails()
55
string configFile = AppDomain.CurrentDomain.SetupInformation.ConfigurationFile;
56
Assert.IsFalse( new AssemblyReader( configFile ).IsValidPeFile );
60
public void IsDotNetFile()
62
Assert.IsTrue( rdr.IsDotNetFile );
66
public void ImageRuntimeVersion()
68
string runtimeVersion = rdr.ImageRuntimeVersion;
70
StringAssert.StartsWith( "v", runtimeVersion );
71
new Version( runtimeVersion.Substring( 1 ) );
72
// This fails when we force running under a prior version
73
// Assert.LessOrEqual( version, Environment.Version );
1
// ****************************************************************
2
// Copyright 2007, Charlie Poole
3
// This is free software licensed under the NUnit license. You may
4
// obtain a copy of the license at http://nunit.org
5
// ****************************************************************
10
namespace NUnit.Core.Tests
13
public class AssemblyReaderTests
15
private AssemblyReader rdr;
18
public void CreateReader()
20
rdr = new AssemblyReader( this.GetType().Assembly );
24
public void DisposeReader()
33
public void CreateFromPath()
35
string path = AssemblyHelper.GetAssemblyPath(System.Reflection.Assembly.GetAssembly(GetType()));
36
Assert.AreEqual(path, new AssemblyReader(path).AssemblyPath);
40
public void CreateFromAssembly()
42
string path = AssemblyHelper.GetAssemblyPath(System.Reflection.Assembly.GetAssembly(GetType()));
43
Assert.AreEqual(path, rdr.AssemblyPath);
47
public void IsValidPeFile()
49
Assert.IsTrue( rdr.IsValidPeFile );
53
public void IsValidPeFile_Fails()
55
string configFile = AppDomain.CurrentDomain.SetupInformation.ConfigurationFile;
56
Assert.IsFalse( new AssemblyReader( configFile ).IsValidPeFile );
60
public void IsDotNetFile()
62
Assert.IsTrue( rdr.IsDotNetFile );
66
public void ImageRuntimeVersion()
68
string runtimeVersion = rdr.ImageRuntimeVersion;
70
StringAssert.StartsWith( "v", runtimeVersion );
71
new Version( runtimeVersion.Substring( 1 ) );
72
// This fails when we force running under a prior version
73
// Assert.LessOrEqual( version, Environment.Version );