Created TypeFinder_Tests.

pull/96/head
Halil İbrahim Kalkan 8 years ago
parent b2b8074eab
commit 7827dfad4c

@ -14,7 +14,7 @@ namespace Volo.Abp.Reflection
[InlineData(new object[] { new Type[] { } })]
[InlineData(new object[] { new[] { typeof(IndependentEmptyModule) } })]
[InlineData(new object[] { new[] { typeof(AbpKernelModule), typeof(IndependentEmptyModule) } })]
public void Should_Get_Assemblies_Of_All_Modules(Type[] moduleTypes)
public void Should_Get_Assemblies_Of_Given_Modules(Type[] moduleTypes)
{
//Arrange

@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using System.Reflection;
using Microsoft.Extensions.Logging;
using NSubstitute;
using Shouldly;
using Xunit;
namespace Volo.Abp.Reflection
{
public class TypeFinder_Tests
{
[Fact]
public void Should_Find_Types_In_Given_Assemblies()
{
//Arrange
var fakeAssemblyFinder = Substitute.For<IAssemblyFinder>();
fakeAssemblyFinder.Assemblies.Returns(new List<Assembly>
{
typeof(AbpKernelModule).GetAssembly(),
typeof(TypeFinder_Tests).GetAssembly()
});
//Act
var typeFinder = new TypeFinder(fakeAssemblyFinder, Substitute.For<ILogger<TypeFinder>>());
//Assert
typeFinder.Types.ShouldContain(typeof(AbpKernelModule));
typeFinder.Types.ShouldContain(typeof(TypeFinder_Tests));
}
}
}
Loading…
Cancel
Save