Skip to content

Commit

Permalink
updated tests to not include example project
Browse files Browse the repository at this point in the history
  • Loading branch information
nwestfall committed Mar 14, 2021
1 parent 8055889 commit 673feb7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
5 changes: 2 additions & 3 deletions test/BlazorTenant.Tests/BlazorTenant.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@
</PackageReference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\BlazorTenant\BlazorTenant.csproj" />
<ProjectReference Include="..\..\example\BLazorTenant.Example\BlazorTenant.Example.csproj" />
<ItemGroup>
<ProjectReference Include="..\..\src\BlazorTenant\BlazorTenant.csproj" />
</ItemGroup>

</Project>
15 changes: 11 additions & 4 deletions test/BlazorTenant.Tests/MultiTenantRouterTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using Microsoft.Extensions.DependencyInjection;
using System.Collections.ObjectModel;
using System.Collections.Generic;
using System.Reflection;

namespace BlazorTenant.Tests
{
Expand Down Expand Up @@ -54,7 +55,7 @@ public void NoTenant(bool preferExactMatches)
};

var cut = ctx.RenderComponent<MultiTenantRouter>(
("AppAssembly", typeof(BlazorTenant.Example.Program).Assembly),
("AppAssembly", Assembly.GetExecutingAssembly()),
("PreferExactMatches", preferExactMatches),
("Found", found),
("NotFound", notFound),
Expand Down Expand Up @@ -99,7 +100,7 @@ public void ValidTenant(bool preferExactMatches)
};

var cut = ctx.RenderComponent<MultiTenantRouter>(
("AppAssembly", typeof(BlazorTenant.Example.Program).Assembly),
("AppAssembly", Assembly.GetExecutingAssembly()),
("PreferExactMatches", preferExactMatches),
("Found", found),
("NotFound", notFound),
Expand All @@ -118,7 +119,7 @@ public void ValidTenantInvalidPage(bool preferExactMatches)

SetupContext(ctx);

_navigationManager.NotifyLocationChanged("https://www.example.com/company1/nopage", false);
_navigationManager.NotifyLocationChanged("https://www.example.com/company1/test", false);

RenderFragment<RouteData> found = __builder =>
{
Expand All @@ -144,7 +145,7 @@ public void ValidTenantInvalidPage(bool preferExactMatches)
};

var cut = ctx.RenderComponent<MultiTenantRouter>(
("AppAssembly", typeof(BlazorTenant.Example.Program).Assembly),
("AppAssembly", Assembly.GetExecutingAssembly()),
("PreferExactMatches", preferExactMatches),
("Found", found),
("NotFound", notFound),
Expand Down Expand Up @@ -188,5 +189,11 @@ public Task EnableNavigationInterceptionAsync()
return Task.CompletedTask;
}
}

[Route("")]
public class IndexComponent : ComponentBase { }

[Route("foo")]
public class FooComponent : ComponentBase { }
}
}

0 comments on commit 673feb7

Please sign in to comment.