Add test for IAssembly.GetTypes() wrapper

This commit is contained in:
Jozef Izso 2017-06-09 21:46:33 +02:00
Родитель f51eb237a2
Коммит a052017fd2
1 изменённых файлов: 17 добавлений и 0 удалений

Просмотреть файл

@ -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.");
}
}
}