From a052017fd28d3b6008339c0afc889e73e4f7ee47 Mon Sep 17 00:00:00 2001 From: Jozef Izso Date: Fri, 9 Jun 2017 21:46:33 +0200 Subject: [PATCH] Add test for IAssembly.GetTypes() wrapper --- .../Reflection/AssemblyWrapTests.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/SystemWrapper.Tests/Reflection/AssemblyWrapTests.cs b/SystemWrapper.Tests/Reflection/AssemblyWrapTests.cs index 6457691..e34cfb3 100644 --- a/SystemWrapper.Tests/Reflection/AssemblyWrapTests.cs +++ b/SystemWrapper.Tests/Reflection/AssemblyWrapTests.cs @@ -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."); + } } }