Skip to content

Commit

Permalink
[#227] [add] FindTypesDerivedFrom_Controller2With1TypeDerived_1TestCo…
Browse files Browse the repository at this point in the history
…ntrollersReturned test
  • Loading branch information
i4004 committed Jan 15, 2024
1 parent 1449128 commit 6a3a7b4
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/Simplify.Web.Tests/Meta/SimplifyWebTypesFinderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,25 @@ public void FindTypesDerivedFrom_AsyncControllerWith1TypeDerived_1TestController
Assert.AreEqual("Simplify.Web.Tests.TestEntities.TestController2", types[0].FullName);
}


[Test]
public void FindTypesDerivedFrom_Controller2With1TypeDerived_1TestControllersReturned()
{
// Assign

SimplifyWebTypesFinder.ExcludedAssembliesPrefixes.Remove("Simplify");
SimplifyWebTypesFinder.ExcludedAssembliesPrefixes.Add("DynamicProxyGenAssembly2");
SimplifyWebTypesFinder.CleanLoadedTypesAndAssembliesInfo();

// Act
var types = SimplifyWebTypesFinder.FindTypesDerivedFrom<Controller2>();

// Assert

Assert.AreEqual(1, types.Count);
Assert.AreEqual("Simplify.Web.Tests.TestEntities.TestControllerV2", types[0].FullName);
}

[Test]
public void FindTypesDerivedFrom_NoDerivedTypes_NullReturned()
{
Expand Down

0 comments on commit 6a3a7b4

Please sign in to comment.