-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from vcup/main
feat: Scheme auto configuration improvement.
- Loading branch information
Showing
10 changed files
with
147 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
...asyAbp.Abp.GraphQL.Provider.Shared.Tests/EasyAbp.Abp.GraphQL.Provider.Shared.Tests.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<RootNamespace>EasyAbp.Abp.GraphQL</RootNamespace> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\src\EasyAbp.Abp.GraphQL.Provider.Shared\EasyAbp.Abp.GraphQL.Provider.Shared.csproj" /> | ||
<ProjectReference Include="..\EasyAbp.Abp.GraphQL.TestBase\EasyAbp.Abp.GraphQL.TestBase.csproj" /> | ||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
namespace EasyAbp.Abp.GraphQL; | ||
|
||
internal class EmptyDto; |
6 changes: 6 additions & 0 deletions
6
test/EasyAbp.Abp.GraphQL.Provider.Shared.Tests/GraphQLProviderSharedTestBase.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
namespace EasyAbp.Abp.GraphQL; | ||
|
||
public abstract class GraphQLProviderSharedTestBase : GraphQLTestBase<GraphQLProviderSharedTestModule> | ||
{ | ||
|
||
} |
11 changes: 11 additions & 0 deletions
11
test/EasyAbp.Abp.GraphQL.Provider.Shared.Tests/GraphQLProviderSharedTestModule.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using Volo.Abp.Modularity; | ||
|
||
namespace EasyAbp.Abp.GraphQL; | ||
|
||
[DependsOn( | ||
typeof(AbpGraphQLTestBaseModule), | ||
typeof(AbpGraphQLProviderSharedModule) | ||
)] | ||
public class GraphQLProviderSharedTestModule : AbpModule | ||
{ | ||
} |
9 changes: 9 additions & 0 deletions
9
test/EasyAbp.Abp.GraphQL.Provider.Shared.Tests/IEmptyAppService.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using System; | ||
using Volo.Abp.Application.Dtos; | ||
using Volo.Abp.Application.Services; | ||
|
||
namespace EasyAbp.Abp.GraphQL; | ||
|
||
internal interface IEmptyAppService2 : IReadOnlyAppService<EmptyDto, Guid>; | ||
internal interface IEmptyAppService3 : IReadOnlyAppService<EmptyDto, Guid, PagedAndSortedResultRequestDto>; | ||
internal interface IEmptyAppService4 : IReadOnlyAppService<EmptyDto, EmptyDto, Guid, PagedAndSortedResultRequestDto>; |
57 changes: 57 additions & 0 deletions
57
....Abp.GraphQL.Provider.Shared.Tests/Tests/AbpGraphQLAppServiceSchemeConfigurationsTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
using System.Reflection; | ||
using NSubstitute; | ||
using Shouldly; | ||
using Xunit; | ||
|
||
namespace EasyAbp.Abp.GraphQL.Tests; | ||
|
||
public class AbpGraphQLAppServiceSchemeConfigurationsTests | ||
{ | ||
[Fact] | ||
public void Configure_With_Assembly_Should_Scan_IEmptyAppService4() | ||
{ | ||
// arrange | ||
var assembly = Substitute.For<Assembly>(); | ||
assembly.DefinedTypes.Returns([typeof(IEmptyAppService4).GetTypeInfo()]); | ||
|
||
var config = new AbpGraphQLAppServiceSchemeConfigurations(); | ||
|
||
// act | ||
config.Configure(assembly); | ||
|
||
// assert | ||
config.GetConfigurations().Count.ShouldBePositive(); | ||
} | ||
|
||
[Fact] | ||
public void Configure_With_Assembly_Should_Scan_IEmptyAppService3() | ||
{ | ||
// arrange | ||
var assembly = Substitute.For<Assembly>(); | ||
assembly.DefinedTypes.Returns([typeof(IEmptyAppService3).GetTypeInfo()]); | ||
|
||
var config = new AbpGraphQLAppServiceSchemeConfigurations(); | ||
|
||
// act | ||
config.Configure(assembly); | ||
|
||
// assert | ||
config.GetConfigurations().Count.ShouldBePositive(); | ||
} | ||
|
||
[Fact] | ||
public void Configure_With_Assembly_Should_Scan_IEmptyAppService2() | ||
{ | ||
// arrange | ||
var assembly = Substitute.For<Assembly>(); | ||
assembly.DefinedTypes.Returns([typeof(IEmptyAppService2).GetTypeInfo()]); | ||
|
||
var config = new AbpGraphQLAppServiceSchemeConfigurations(); | ||
|
||
// act | ||
config.Configure(assembly); | ||
|
||
// assert | ||
config.GetConfigurations().Count.ShouldBePositive(); | ||
} | ||
} |