Add test for IAssembly.GetTypes() wrapper
This commit is contained in:
Родитель
f51eb237a2
Коммит
a052017fd2
|
@ -1,5 +1,7 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
|
||||
using SystemWrapper.IO;
|
||||
using SystemWrapper.Reflection;
|
||||
using NUnit.Framework;
|
||||
|
@ -59,5 +61,20 @@ namespace SystemWrapper.Tests.Reflection
|
|||
|
||||
Assert.AreEqual(actualException.Message, "AssemblyWrap instance was not initialized with Assembly object. Use Initialize() method to set Assembly object.");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void GetTypes_AssemblyWrap_ReturnsSameTypesAsOriginalAssembly()
|
||||
{
|
||||
// Arrange
|
||||
var assembly = Assembly.GetExecutingAssembly();
|
||||
var expectedTypes = assembly.GetTypes();
|
||||
var wrapper = new AssemblyWrap(assembly);
|
||||
|
||||
// Act
|
||||
var actualTypes = wrapper.GetTypes();
|
||||
|
||||
// Assert
|
||||
CollectionAssert.AreEquivalent(expectedTypes, actualTypes, $"{nameof(AssemblyWrap)} must return the same types as original Assembly instance.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче