mirror of https://github.com/abpframework/abp.git
2 changed files with 36 additions and 1 deletions
@ -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…
Reference in new issue