public void TestEqualsAllSame() { var first = new Assembly(this.SampleAssemblyPath); var second = new AssemblyStub("MockEverythingTests.Inspection.Demo, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"); Assert.IsTrue(first.Equals(second)); Assert.IsTrue(second.Equals(first)); }
public void TestEqualsFullNameDifferent() { var first = new Assembly(this.SampleAssemblyPath); var second = new AssemblyStub("WrongFullName"); Assert.IsFalse(first.Equals(second)); Assert.IsFalse(second.Equals(first)); }
public void TestAlterVersion() { var assembly = new Assembly(this.SampleAssemblyPath); assembly.AlterVersion(new Version(3, 0, 14, 5021)); var actual = assembly.Version; var expected = new Version("3.0.14.5021"); Assert.AreEqual(expected, actual); }
public void TestFindMatchParamsParameterReal() { var firstAssemblyPath = new Uri(typeof(StringFormat).Assembly.CodeBase).AbsolutePath; var secondAssemblyPath = new Uri(typeof(string).Assembly.CodeBase).AbsolutePath; var methodFromFirst = new Assembly(firstAssemblyPath).FindType("MockEverythingTests.Engine.Browsers.StringFormat").FindMethods(MemberType.Static).Single(); var typeFromSecond = new Assembly(secondAssemblyPath).FindType("System.String"); var actual = new MethodMatching().FindMatch(methodFromFirst, typeFromSecond).Name; var expected = "Format"; Assert.AreEqual(expected, actual); }
public void TestFindType() { var actual = new Assembly(this.SampleAssemblyPath).FindType("MockEverythingTests.Inspection.Demo.SimpleClass").Name; var expected = "SimpleClass"; Assert.AreEqual(expected, actual); }
public void TestEqualsWrongType() { var first = new Assembly(this.SampleAssemblyPath); Assert.IsFalse(first.Equals(27)); }
public void TestEqualsNull() { var first = new Assembly(this.SampleAssemblyPath); Assert.IsFalse(first.Equals(null)); }
public void TestConstructorWithWrongNameLazy() { // The assembly shouldn't be loaded when a constructor is called, but only when we actually need it. Thus, calling a constructor with a name shouldn't be a problem. var assembly = new Assembly(@"not a real path"); Assert.IsNotNull(assembly); }
public void TestConstructorWithWrongName() { var assembly = new Assembly(@"not a real path"); assembly.FindTypes().ToList(); }
private bool TypeExists(string typeName, MemberType type, params System.Type[] expectedAttributes) { var assembly = new Assembly(this.SampleAssemblyPath); return assembly.FindTypes(type, expectedAttributes).Select(t => t.Name).Contains(typeName); }
private bool TypeExists(string typeName) { var assembly = new Assembly(this.SampleAssemblyPath); return assembly.FindTypes().Select(t => t.Name).Contains(typeName); }
public void TestGetVersion() { var actual = new Assembly(this.SampleAssemblyPath).Version; var expected = new Version("1.0.0.0"); Assert.AreEqual(expected, actual); }
public void TestGetFilePath() { var actual = new Assembly(this.SampleAssemblyPath).FilePath; var expected = this.SampleAssemblyPath; Assert.AreEqual(expected, actual); }