From 772d9f5c9a3365c3868156b75693a16354a2f8b0 Mon Sep 17 00:00:00 2001 From: Justin Yoo Date: Fri, 10 Jul 2020 15:58:22 +0900 Subject: [PATCH] Restructure test projects --- .github/workflows/release-all.yaml | 3 ++ Aliencube.AzureFunctions.Extensions.sln | 30 ++++++++---- ...nfiguration.AppSettings.Tests.Fakes.csproj | 11 +++++ .../FakeProductSettings.cs | 2 +- ...ons.Configuration.AppSettings.Tests.csproj | 7 ++- .../ConfigurationBinderExtensionsTests.cs | 2 +- ...ons.DependencyInjection.Tests.Fakes.csproj | 11 +++++ .../FakeClass.cs | 42 ++++++++-------- .../FakeFunctionWithILogger.cs | 2 +- .../FakeFunctionWithTraceWriter.cs | 2 +- .../FakeMethodAttribute.cs | 24 +++++----- .../FakeModule.cs | 2 +- .../FakeTraceWriter.cs | 2 +- .../FakeTriggerWithILogger.cs | 2 +- .../FakeTriggerWithTraceWriter.cs | 2 +- .../IFakeFunctionWithILogger.cs | 2 +- .../IFakeFunctionWithTraceWriter.cs | 2 +- .../IFakeInterface.cs | 2 +- .../IFakeTriggerWithILogger.cs | 2 +- .../IFakeTriggerWithTraceWriter.cs | 2 +- ...xtensions.DependencyInjection.Tests.csproj | 7 ++- .../Containers/ContainerBuilderTests.cs | 2 +- .../Extensions/IFunctionExtensionsTests.cs | 2 +- .../Functions/FunctionBaseTests.cs | 2 +- .../Functions/FunctionFactoryTests.cs | 2 +- .../Triggers/TriggerBaseTests.cs | 2 +- .../Validators/LoggerTypeValidatorTests.cs | 2 +- ...ions.Extensions.OpenApi.Tests.Fakes.csproj | 17 +++++++ .../FakeEnum.cs | 15 ++++++ .../FakeHttpTrigger.cs | 48 +++++++++++++++++++ .../FakeModel.cs | 37 ++++++++++++++ .../FakeModelWithCircularRef.cs | 14 ++++++ .../FakeModelWithCircularRefSub.cs | 13 +++++ .../FakeModelWithList.cs | 16 +++++++ .../FakeQueryCollection.cs | 48 +++++++++++++++++++ .../FakeSubModel.cs | 13 +++++ .../IFakeBaseInterface.cs | 15 ++++++ .../IFakeInheritedInterface.cs | 10 ++++ ...eFunctions.Extensions.OpenApi.Tests.csproj | 3 +- .../Extensions/EnumExtensionsTests.cs | 2 +- .../Extensions/MemberInfoExtensionsTests.cs | 2 +- .../Extensions/MethodInfoExtensionsTests.cs | 2 +- .../OpenApiSchemaExtensionsTests.cs | 2 +- .../Extensions/PropertyInfoExtensionsTests.cs | 2 +- ....AzureFunctions.FunctionAppV2.Tests.csproj | 2 +- .../SampleHttpTriggerTests.cs | 2 +- 46 files changed, 363 insertions(+), 73 deletions(-) create mode 100644 test/Aliencube.AzureFunctions.Extensions.Configuration.AppSettings.Tests.Fakes/Aliencube.AzureFunctions.Extensions.Configuration.AppSettings.Tests.Fakes.csproj rename test/{Aliencube.AzureFunctions.Tests.Fakes => Aliencube.AzureFunctions.Extensions.Configuration.AppSettings.Tests.Fakes}/FakeProductSettings.cs (76%) create mode 100644 test/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes.csproj rename test/{Aliencube.AzureFunctions.Tests.Fakes => Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes}/FakeClass.cs (83%) rename test/{Aliencube.AzureFunctions.Tests.Fakes => Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes}/FakeFunctionWithILogger.cs (88%) rename test/{Aliencube.AzureFunctions.Tests.Fakes => Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes}/FakeFunctionWithTraceWriter.cs (88%) rename test/{Aliencube.AzureFunctions.Tests.Fakes => Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes}/FakeMethodAttribute.cs (77%) rename test/{Aliencube.AzureFunctions.Tests.Fakes => Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes}/FakeModule.cs (88%) rename test/{Aliencube.AzureFunctions.Tests.Fakes => Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes}/FakeTraceWriter.cs (88%) rename test/{Aliencube.AzureFunctions.Tests.Fakes => Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes}/FakeTriggerWithILogger.cs (90%) rename test/{Aliencube.AzureFunctions.Tests.Fakes => Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes}/FakeTriggerWithTraceWriter.cs (90%) rename test/{Aliencube.AzureFunctions.Tests.Fakes => Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes}/IFakeFunctionWithILogger.cs (80%) rename test/{Aliencube.AzureFunctions.Tests.Fakes => Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes}/IFakeFunctionWithTraceWriter.cs (81%) rename test/{Aliencube.AzureFunctions.Tests.Fakes => Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes}/IFakeInterface.cs (87%) rename test/{Aliencube.AzureFunctions.Tests.Fakes => Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes}/IFakeTriggerWithILogger.cs (80%) rename test/{Aliencube.AzureFunctions.Tests.Fakes => Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes}/IFakeTriggerWithTraceWriter.cs (81%) create mode 100644 test/Aliencube.AzureFunctions.Extensions.OpenApi.Tests.Fakes/Aliencube.AzureFunctions.Extensions.OpenApi.Tests.Fakes.csproj create mode 100644 test/Aliencube.AzureFunctions.Extensions.OpenApi.Tests.Fakes/FakeEnum.cs create mode 100644 test/Aliencube.AzureFunctions.Extensions.OpenApi.Tests.Fakes/FakeHttpTrigger.cs create mode 100644 test/Aliencube.AzureFunctions.Extensions.OpenApi.Tests.Fakes/FakeModel.cs create mode 100644 test/Aliencube.AzureFunctions.Extensions.OpenApi.Tests.Fakes/FakeModelWithCircularRef.cs create mode 100644 test/Aliencube.AzureFunctions.Extensions.OpenApi.Tests.Fakes/FakeModelWithCircularRefSub.cs create mode 100644 test/Aliencube.AzureFunctions.Extensions.OpenApi.Tests.Fakes/FakeModelWithList.cs create mode 100644 test/Aliencube.AzureFunctions.Extensions.OpenApi.Tests.Fakes/FakeQueryCollection.cs create mode 100644 test/Aliencube.AzureFunctions.Extensions.OpenApi.Tests.Fakes/FakeSubModel.cs create mode 100644 test/Aliencube.AzureFunctions.Extensions.OpenApi.Tests.Fakes/IFakeBaseInterface.cs create mode 100644 test/Aliencube.AzureFunctions.Extensions.OpenApi.Tests.Fakes/IFakeInheritedInterface.cs diff --git a/.github/workflows/release-all.yaml b/.github/workflows/release-all.yaml index b433b3f..8271331 100644 --- a/.github/workflows/release-all.yaml +++ b/.github/workflows/release-all.yaml @@ -71,6 +71,7 @@ jobs: run: | dir dotnet build ./src/Aliencube.AzureFunctions.Extensions.Configuration.AppSettings -c Release -p:Version=${{ steps.release.outputs.version }} -v minimal + dotnet build ./test/Aliencube.AzureFunctions.Extensions.Configuration.AppSettings.Tests -c Release - name: Build solution for Configuration.Json if: steps.release.outputs.module == 'configjson' @@ -78,6 +79,7 @@ jobs: run: | dir dotnet build ./src/Aliencube.AzureFunctions.Extensions.Configuration.Json -c Release -p:Version=${{ steps.release.outputs.version }} -v minimal + dotnet build ./test/Aliencube.AzureFunctions.Extensions.Configuration.Json.Tests -c Release - name: Build solution for DependencyInjection if: steps.release.outputs.module == 'di' @@ -85,6 +87,7 @@ jobs: run: | dir dotnet build ./src/Aliencube.AzureFunctions.Extensions.DependencyInjection -c Release -p:Version=${{ steps.release.outputs.version }} -v minimal + dotnet build ./test/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests -c Release - name: Build solution for OpenApi if: steps.release.outputs.module == 'swagger' diff --git a/Aliencube.AzureFunctions.Extensions.sln b/Aliencube.AzureFunctions.Extensions.sln index 4b63433..2a286bb 100644 --- a/Aliencube.AzureFunctions.Extensions.sln +++ b/Aliencube.AzureFunctions.Extensions.sln @@ -21,8 +21,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aliencube.AzureFunctions.Ex EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests", "test\Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests\Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.csproj", "{49C186AD-802E-4C6A-86B1-2092D3FC6660}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aliencube.AzureFunctions.Tests.Fakes", "test\Aliencube.AzureFunctions.Tests.Fakes\Aliencube.AzureFunctions.Tests.Fakes.csproj", "{16B414D3-F4E4-4236-A7C4-75742626C2C1}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aliencube.AzureFunctions.FunctionAppV2", "src\Aliencube.AzureFunctions.FunctionAppV2\Aliencube.AzureFunctions.FunctionAppV2.csproj", "{515EB3CC-7FD5-4495-92EF-BB01ECAF9556}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aliencube.AzureFunctions.FunctionAppV2.Tests", "test\Aliencube.AzureFunctions.FunctionAppV2.Tests\Aliencube.AzureFunctions.FunctionAppV2.Tests.csproj", "{8C565D1A-D0B4-4901-A592-88862E8C6962}" @@ -47,7 +45,13 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aliencube.AzureFunctions.Ex EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aliencube.AzureFunctions.Extensions.OpenApi.CLI.Tests", "test\Aliencube.AzureFunctions.Extensions.OpenApi.CLI.Tests\Aliencube.AzureFunctions.Extensions.OpenApi.CLI.Tests.csproj", "{65AED6F0-D27E-4D6E-BA42-AD6EE1338082}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aliencube.AzureFunctions.Extensions.Configuration.Json.Tests", "test\Aliencube.AzureFunctions.Extensions.Configuration.Json.Tests\Aliencube.AzureFunctions.Extensions.Configuration.Json.Tests.csproj", "{F0899514-88DC-4CBF-A392-825BDC094689}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aliencube.AzureFunctions.Extensions.Configuration.Json.Tests", "test\Aliencube.AzureFunctions.Extensions.Configuration.Json.Tests\Aliencube.AzureFunctions.Extensions.Configuration.Json.Tests.csproj", "{F0899514-88DC-4CBF-A392-825BDC094689}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aliencube.AzureFunctions.Extensions.Configuration.AppSettings.Tests.Fakes", "test\Aliencube.AzureFunctions.Extensions.Configuration.AppSettings.Tests.Fakes\Aliencube.AzureFunctions.Extensions.Configuration.AppSettings.Tests.Fakes.csproj", "{AC89B7CF-0FA5-49EE-97A8-AB39A5F211A8}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes", "test\Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes\Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes.csproj", "{A50319A4-2476-4FD2-B066-303A3F7CCF73}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aliencube.AzureFunctions.Extensions.OpenApi.Tests.Fakes", "test\Aliencube.AzureFunctions.Extensions.OpenApi.Tests.Fakes\Aliencube.AzureFunctions.Extensions.OpenApi.Tests.Fakes.csproj", "{5C2331B8-EF38-48F3-A060-175530F44F8B}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -63,10 +67,6 @@ Global {49C186AD-802E-4C6A-86B1-2092D3FC6660}.Debug|Any CPU.Build.0 = Debug|Any CPU {49C186AD-802E-4C6A-86B1-2092D3FC6660}.Release|Any CPU.ActiveCfg = Release|Any CPU {49C186AD-802E-4C6A-86B1-2092D3FC6660}.Release|Any CPU.Build.0 = Release|Any CPU - {16B414D3-F4E4-4236-A7C4-75742626C2C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {16B414D3-F4E4-4236-A7C4-75742626C2C1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {16B414D3-F4E4-4236-A7C4-75742626C2C1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {16B414D3-F4E4-4236-A7C4-75742626C2C1}.Release|Any CPU.Build.0 = Release|Any CPU {515EB3CC-7FD5-4495-92EF-BB01ECAF9556}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {515EB3CC-7FD5-4495-92EF-BB01ECAF9556}.Debug|Any CPU.Build.0 = Debug|Any CPU {515EB3CC-7FD5-4495-92EF-BB01ECAF9556}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -119,6 +119,18 @@ Global {F0899514-88DC-4CBF-A392-825BDC094689}.Debug|Any CPU.Build.0 = Debug|Any CPU {F0899514-88DC-4CBF-A392-825BDC094689}.Release|Any CPU.ActiveCfg = Release|Any CPU {F0899514-88DC-4CBF-A392-825BDC094689}.Release|Any CPU.Build.0 = Release|Any CPU + {AC89B7CF-0FA5-49EE-97A8-AB39A5F211A8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AC89B7CF-0FA5-49EE-97A8-AB39A5F211A8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AC89B7CF-0FA5-49EE-97A8-AB39A5F211A8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AC89B7CF-0FA5-49EE-97A8-AB39A5F211A8}.Release|Any CPU.Build.0 = Release|Any CPU + {A50319A4-2476-4FD2-B066-303A3F7CCF73}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A50319A4-2476-4FD2-B066-303A3F7CCF73}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A50319A4-2476-4FD2-B066-303A3F7CCF73}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A50319A4-2476-4FD2-B066-303A3F7CCF73}.Release|Any CPU.Build.0 = Release|Any CPU + {5C2331B8-EF38-48F3-A060-175530F44F8B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5C2331B8-EF38-48F3-A060-175530F44F8B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5C2331B8-EF38-48F3-A060-175530F44F8B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5C2331B8-EF38-48F3-A060-175530F44F8B}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -126,7 +138,6 @@ Global GlobalSection(NestedProjects) = preSolution {EE506010-80F2-40CD-BE0E-861474560592} = {810145E0-41CF-4E24-BD9C-E7517498BA29} {49C186AD-802E-4C6A-86B1-2092D3FC6660} = {8B62E3FB-9062-4716-803A-1FA51FCE68BC} - {16B414D3-F4E4-4236-A7C4-75742626C2C1} = {8B62E3FB-9062-4716-803A-1FA51FCE68BC} {515EB3CC-7FD5-4495-92EF-BB01ECAF9556} = {810145E0-41CF-4E24-BD9C-E7517498BA29} {8C565D1A-D0B4-4901-A592-88862E8C6962} = {8B62E3FB-9062-4716-803A-1FA51FCE68BC} {A2DADE47-5803-49C1-B7AD-4D7FA6515BB4} = {810145E0-41CF-4E24-BD9C-E7517498BA29} @@ -140,6 +151,9 @@ Global {5C35651B-97D0-4115-81FC-ED8D7ACD71A7} = {810145E0-41CF-4E24-BD9C-E7517498BA29} {65AED6F0-D27E-4D6E-BA42-AD6EE1338082} = {8B62E3FB-9062-4716-803A-1FA51FCE68BC} {F0899514-88DC-4CBF-A392-825BDC094689} = {8B62E3FB-9062-4716-803A-1FA51FCE68BC} + {AC89B7CF-0FA5-49EE-97A8-AB39A5F211A8} = {8B62E3FB-9062-4716-803A-1FA51FCE68BC} + {A50319A4-2476-4FD2-B066-303A3F7CCF73} = {8B62E3FB-9062-4716-803A-1FA51FCE68BC} + {5C2331B8-EF38-48F3-A060-175530F44F8B} = {8B62E3FB-9062-4716-803A-1FA51FCE68BC} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {70FEC644-BB3C-4441-AF91-DC694803C8F2} diff --git a/test/Aliencube.AzureFunctions.Extensions.Configuration.AppSettings.Tests.Fakes/Aliencube.AzureFunctions.Extensions.Configuration.AppSettings.Tests.Fakes.csproj b/test/Aliencube.AzureFunctions.Extensions.Configuration.AppSettings.Tests.Fakes/Aliencube.AzureFunctions.Extensions.Configuration.AppSettings.Tests.Fakes.csproj new file mode 100644 index 0000000..ef0e03e --- /dev/null +++ b/test/Aliencube.AzureFunctions.Extensions.Configuration.AppSettings.Tests.Fakes/Aliencube.AzureFunctions.Extensions.Configuration.AppSettings.Tests.Fakes.csproj @@ -0,0 +1,11 @@ + + + + net461;netstandard2.0 + + + + + + + diff --git a/test/Aliencube.AzureFunctions.Tests.Fakes/FakeProductSettings.cs b/test/Aliencube.AzureFunctions.Extensions.Configuration.AppSettings.Tests.Fakes/FakeProductSettings.cs similarity index 76% rename from test/Aliencube.AzureFunctions.Tests.Fakes/FakeProductSettings.cs rename to test/Aliencube.AzureFunctions.Extensions.Configuration.AppSettings.Tests.Fakes/FakeProductSettings.cs index ebf8316..6f01345 100644 --- a/test/Aliencube.AzureFunctions.Tests.Fakes/FakeProductSettings.cs +++ b/test/Aliencube.AzureFunctions.Extensions.Configuration.AppSettings.Tests.Fakes/FakeProductSettings.cs @@ -1,4 +1,4 @@ -namespace Aliencube.AzureFunctions.Tests.Fakes +namespace Aliencube.AzureFunctions.Extensions.Configuration.AppSettings.Tests.Fakes { /// /// This represents the fake product settings entity. diff --git a/test/Aliencube.AzureFunctions.Extensions.Configuration.AppSettings.Tests/Aliencube.AzureFunctions.Extensions.Configuration.AppSettings.Tests.csproj b/test/Aliencube.AzureFunctions.Extensions.Configuration.AppSettings.Tests/Aliencube.AzureFunctions.Extensions.Configuration.AppSettings.Tests.csproj index 25fe11f..3f16284 100644 --- a/test/Aliencube.AzureFunctions.Extensions.Configuration.AppSettings.Tests/Aliencube.AzureFunctions.Extensions.Configuration.AppSettings.Tests.csproj +++ b/test/Aliencube.AzureFunctions.Extensions.Configuration.AppSettings.Tests/Aliencube.AzureFunctions.Extensions.Configuration.AppSettings.Tests.csproj @@ -18,9 +18,12 @@ + + + + - - + diff --git a/test/Aliencube.AzureFunctions.Extensions.Configuration.AppSettings.Tests/Extensions/ConfigurationBinderExtensionsTests.cs b/test/Aliencube.AzureFunctions.Extensions.Configuration.AppSettings.Tests/Extensions/ConfigurationBinderExtensionsTests.cs index b10f6a7..471182d 100644 --- a/test/Aliencube.AzureFunctions.Extensions.Configuration.AppSettings.Tests/Extensions/ConfigurationBinderExtensionsTests.cs +++ b/test/Aliencube.AzureFunctions.Extensions.Configuration.AppSettings.Tests/Extensions/ConfigurationBinderExtensionsTests.cs @@ -1,6 +1,6 @@ using System.IO; -using Aliencube.AzureFunctions.Tests.Fakes; +using Aliencube.AzureFunctions.Extensions.Configuration.AppSettings.Tests.Fakes; using FluentAssertions; diff --git a/test/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes.csproj b/test/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes.csproj new file mode 100644 index 0000000..a0bc249 --- /dev/null +++ b/test/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes.csproj @@ -0,0 +1,11 @@ + + + + net461;netstandard2.0 + + + + + + + diff --git a/test/Aliencube.AzureFunctions.Tests.Fakes/FakeClass.cs b/test/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes/FakeClass.cs similarity index 83% rename from test/Aliencube.AzureFunctions.Tests.Fakes/FakeClass.cs rename to test/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes/FakeClass.cs index 02def93..958228d 100644 --- a/test/Aliencube.AzureFunctions.Tests.Fakes/FakeClass.cs +++ b/test/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes/FakeClass.cs @@ -1,21 +1,21 @@ -namespace Aliencube.AzureFunctions.Tests.Fakes -{ - /// - /// This represents the fake class entity. - /// - public class FakeClass : IFakeInterface - { - /// - [FakeMethod] - public bool DoSomething(bool input) - { - return input; - } - - /// - public bool DoOtherThing(bool input) - { - return input; - } - } -} +namespace Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes +{ + /// + /// This represents the fake class entity. + /// + public class FakeClass : IFakeInterface + { + /// + [FakeMethod] + public bool DoSomething(bool input) + { + return input; + } + + /// + public bool DoOtherThing(bool input) + { + return input; + } + } +} diff --git a/test/Aliencube.AzureFunctions.Tests.Fakes/FakeFunctionWithILogger.cs b/test/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes/FakeFunctionWithILogger.cs similarity index 88% rename from test/Aliencube.AzureFunctions.Tests.Fakes/FakeFunctionWithILogger.cs rename to test/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes/FakeFunctionWithILogger.cs index a365f55..44cedb2 100644 --- a/test/Aliencube.AzureFunctions.Tests.Fakes/FakeFunctionWithILogger.cs +++ b/test/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes/FakeFunctionWithILogger.cs @@ -4,7 +4,7 @@ using Microsoft.Extensions.Logging; -namespace Aliencube.AzureFunctions.Tests.Fakes +namespace Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes { /// /// This represents the function entity. diff --git a/test/Aliencube.AzureFunctions.Tests.Fakes/FakeFunctionWithTraceWriter.cs b/test/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes/FakeFunctionWithTraceWriter.cs similarity index 88% rename from test/Aliencube.AzureFunctions.Tests.Fakes/FakeFunctionWithTraceWriter.cs rename to test/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes/FakeFunctionWithTraceWriter.cs index aebe581..ba21ab7 100644 --- a/test/Aliencube.AzureFunctions.Tests.Fakes/FakeFunctionWithTraceWriter.cs +++ b/test/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes/FakeFunctionWithTraceWriter.cs @@ -4,7 +4,7 @@ using Microsoft.Azure.WebJobs.Host; -namespace Aliencube.AzureFunctions.Tests.Fakes +namespace Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes { /// /// This represents the function entity. diff --git a/test/Aliencube.AzureFunctions.Tests.Fakes/FakeMethodAttribute.cs b/test/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes/FakeMethodAttribute.cs similarity index 77% rename from test/Aliencube.AzureFunctions.Tests.Fakes/FakeMethodAttribute.cs rename to test/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes/FakeMethodAttribute.cs index c20294a..d0adc34 100644 --- a/test/Aliencube.AzureFunctions.Tests.Fakes/FakeMethodAttribute.cs +++ b/test/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes/FakeMethodAttribute.cs @@ -1,12 +1,12 @@ -using System; - -namespace Aliencube.AzureFunctions.Tests.Fakes -{ - /// - /// This represents the fake method attribute class. - /// - [AttributeUsage(AttributeTargets.Method, AllowMultiple = true, Inherited = false)] - public class FakeMethodAttribute : Attribute - { - } -} +using System; + +namespace Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes +{ + /// + /// This represents the fake method attribute class. + /// + [AttributeUsage(AttributeTargets.Method, AllowMultiple = true, Inherited = false)] + public class FakeMethodAttribute : Attribute + { + } +} diff --git a/test/Aliencube.AzureFunctions.Tests.Fakes/FakeModule.cs b/test/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes/FakeModule.cs similarity index 88% rename from test/Aliencube.AzureFunctions.Tests.Fakes/FakeModule.cs rename to test/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes/FakeModule.cs index ffa2517..5bee1fd 100644 --- a/test/Aliencube.AzureFunctions.Tests.Fakes/FakeModule.cs +++ b/test/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes/FakeModule.cs @@ -2,7 +2,7 @@ using Microsoft.Extensions.DependencyInjection; -namespace Aliencube.AzureFunctions.Tests.Fakes +namespace Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes { /// /// This represents the module entity for test. diff --git a/test/Aliencube.AzureFunctions.Tests.Fakes/FakeTraceWriter.cs b/test/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes/FakeTraceWriter.cs similarity index 88% rename from test/Aliencube.AzureFunctions.Tests.Fakes/FakeTraceWriter.cs rename to test/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes/FakeTraceWriter.cs index dba505b..b597f18 100644 --- a/test/Aliencube.AzureFunctions.Tests.Fakes/FakeTraceWriter.cs +++ b/test/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes/FakeTraceWriter.cs @@ -2,7 +2,7 @@ using Microsoft.Azure.WebJobs.Host; -namespace Aliencube.AzureFunctions.Tests.Fakes +namespace Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes { /// /// This represents the fake trace writer entity. diff --git a/test/Aliencube.AzureFunctions.Tests.Fakes/FakeTriggerWithILogger.cs b/test/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes/FakeTriggerWithILogger.cs similarity index 90% rename from test/Aliencube.AzureFunctions.Tests.Fakes/FakeTriggerWithILogger.cs rename to test/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes/FakeTriggerWithILogger.cs index 627d7ae..013af70 100644 --- a/test/Aliencube.AzureFunctions.Tests.Fakes/FakeTriggerWithILogger.cs +++ b/test/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes/FakeTriggerWithILogger.cs @@ -4,7 +4,7 @@ using Microsoft.Extensions.Logging; -namespace Aliencube.AzureFunctions.Tests.Fakes +namespace Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes { /// /// This represents the trigger entity. diff --git a/test/Aliencube.AzureFunctions.Tests.Fakes/FakeTriggerWithTraceWriter.cs b/test/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes/FakeTriggerWithTraceWriter.cs similarity index 90% rename from test/Aliencube.AzureFunctions.Tests.Fakes/FakeTriggerWithTraceWriter.cs rename to test/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes/FakeTriggerWithTraceWriter.cs index 965e4d8..611e7f7 100644 --- a/test/Aliencube.AzureFunctions.Tests.Fakes/FakeTriggerWithTraceWriter.cs +++ b/test/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes/FakeTriggerWithTraceWriter.cs @@ -4,7 +4,7 @@ using Microsoft.Azure.WebJobs.Host; -namespace Aliencube.AzureFunctions.Tests.Fakes +namespace Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes { /// /// This represents the function entity. diff --git a/test/Aliencube.AzureFunctions.Tests.Fakes/IFakeFunctionWithILogger.cs b/test/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes/IFakeFunctionWithILogger.cs similarity index 80% rename from test/Aliencube.AzureFunctions.Tests.Fakes/IFakeFunctionWithILogger.cs rename to test/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes/IFakeFunctionWithILogger.cs index 3be2904..68a5b66 100644 --- a/test/Aliencube.AzureFunctions.Tests.Fakes/IFakeFunctionWithILogger.cs +++ b/test/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes/IFakeFunctionWithILogger.cs @@ -2,7 +2,7 @@ using Microsoft.Extensions.Logging; -namespace Aliencube.AzureFunctions.Tests.Fakes +namespace Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes { /// /// This provides interfaces to the class. diff --git a/test/Aliencube.AzureFunctions.Tests.Fakes/IFakeFunctionWithTraceWriter.cs b/test/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes/IFakeFunctionWithTraceWriter.cs similarity index 81% rename from test/Aliencube.AzureFunctions.Tests.Fakes/IFakeFunctionWithTraceWriter.cs rename to test/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes/IFakeFunctionWithTraceWriter.cs index e831c2f..4495152 100644 --- a/test/Aliencube.AzureFunctions.Tests.Fakes/IFakeFunctionWithTraceWriter.cs +++ b/test/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes/IFakeFunctionWithTraceWriter.cs @@ -2,7 +2,7 @@ using Microsoft.Azure.WebJobs.Host; -namespace Aliencube.AzureFunctions.Tests.Fakes +namespace Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes { /// /// This provides interfaces to the class. diff --git a/test/Aliencube.AzureFunctions.Tests.Fakes/IFakeInterface.cs b/test/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes/IFakeInterface.cs similarity index 87% rename from test/Aliencube.AzureFunctions.Tests.Fakes/IFakeInterface.cs rename to test/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes/IFakeInterface.cs index dc50dac..e20075f 100644 --- a/test/Aliencube.AzureFunctions.Tests.Fakes/IFakeInterface.cs +++ b/test/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes/IFakeInterface.cs @@ -1,4 +1,4 @@ -namespace Aliencube.AzureFunctions.Tests.Fakes +namespace Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes { /// /// This provides interfaces to the class. diff --git a/test/Aliencube.AzureFunctions.Tests.Fakes/IFakeTriggerWithILogger.cs b/test/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes/IFakeTriggerWithILogger.cs similarity index 80% rename from test/Aliencube.AzureFunctions.Tests.Fakes/IFakeTriggerWithILogger.cs rename to test/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes/IFakeTriggerWithILogger.cs index 53760a4..48122cd 100644 --- a/test/Aliencube.AzureFunctions.Tests.Fakes/IFakeTriggerWithILogger.cs +++ b/test/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes/IFakeTriggerWithILogger.cs @@ -2,7 +2,7 @@ using Microsoft.Extensions.Logging; -namespace Aliencube.AzureFunctions.Tests.Fakes +namespace Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes { /// /// This provides interfaces to the class. diff --git a/test/Aliencube.AzureFunctions.Tests.Fakes/IFakeTriggerWithTraceWriter.cs b/test/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes/IFakeTriggerWithTraceWriter.cs similarity index 81% rename from test/Aliencube.AzureFunctions.Tests.Fakes/IFakeTriggerWithTraceWriter.cs rename to test/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes/IFakeTriggerWithTraceWriter.cs index f518084..050abbe 100644 --- a/test/Aliencube.AzureFunctions.Tests.Fakes/IFakeTriggerWithTraceWriter.cs +++ b/test/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes/IFakeTriggerWithTraceWriter.cs @@ -2,7 +2,7 @@ using Microsoft.Azure.WebJobs.Host; -namespace Aliencube.AzureFunctions.Tests.Fakes +namespace Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes { /// /// This provides interfaces to the class. diff --git a/test/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.csproj b/test/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.csproj index 6c80ddd..38bd067 100644 --- a/test/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.csproj +++ b/test/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.csproj @@ -18,9 +18,12 @@ + + + + - - + diff --git a/test/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests/Containers/ContainerBuilderTests.cs b/test/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests/Containers/ContainerBuilderTests.cs index cf2557c..b528844 100644 --- a/test/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests/Containers/ContainerBuilderTests.cs +++ b/test/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests/Containers/ContainerBuilderTests.cs @@ -1,5 +1,5 @@ using Aliencube.AzureFunctions.Extensions.DependencyInjection.Abstractions; -using Aliencube.AzureFunctions.Tests.Fakes; +using Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes; using FluentAssertions; diff --git a/test/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests/Extensions/IFunctionExtensionsTests.cs b/test/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests/Extensions/IFunctionExtensionsTests.cs index 73da0d2..91a5a58 100644 --- a/test/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests/Extensions/IFunctionExtensionsTests.cs +++ b/test/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests/Extensions/IFunctionExtensionsTests.cs @@ -1,5 +1,5 @@ using Aliencube.AzureFunctions.Extensions.DependencyInjection.Extensions; -using Aliencube.AzureFunctions.Tests.Fakes; +using Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes; using FluentAssertions; diff --git a/test/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests/Functions/FunctionBaseTests.cs b/test/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests/Functions/FunctionBaseTests.cs index 584d0a1..7ae6f78 100644 --- a/test/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests/Functions/FunctionBaseTests.cs +++ b/test/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests/Functions/FunctionBaseTests.cs @@ -1,4 +1,4 @@ -using Aliencube.AzureFunctions.Tests.Fakes; +using Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes; using FluentAssertions; diff --git a/test/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests/Functions/FunctionFactoryTests.cs b/test/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests/Functions/FunctionFactoryTests.cs index 77949a9..c67deb8 100644 --- a/test/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests/Functions/FunctionFactoryTests.cs +++ b/test/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests/Functions/FunctionFactoryTests.cs @@ -1,4 +1,4 @@ -using Aliencube.AzureFunctions.Tests.Fakes; +using Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes; using FluentAssertions; diff --git a/test/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests/Triggers/TriggerBaseTests.cs b/test/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests/Triggers/TriggerBaseTests.cs index 5f0e93b..2e3247c 100644 --- a/test/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests/Triggers/TriggerBaseTests.cs +++ b/test/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests/Triggers/TriggerBaseTests.cs @@ -1,6 +1,6 @@ using System.Threading.Tasks; -using Aliencube.AzureFunctions.Tests.Fakes; +using Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes; using FluentAssertions; diff --git a/test/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests/Validators/LoggerTypeValidatorTests.cs b/test/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests/Validators/LoggerTypeValidatorTests.cs index 2018e6b..57cb39f 100644 --- a/test/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests/Validators/LoggerTypeValidatorTests.cs +++ b/test/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests/Validators/LoggerTypeValidatorTests.cs @@ -1,4 +1,4 @@ -using Aliencube.AzureFunctions.Tests.Fakes; +using Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes; using FluentAssertions; diff --git a/test/Aliencube.AzureFunctions.Extensions.OpenApi.Tests.Fakes/Aliencube.AzureFunctions.Extensions.OpenApi.Tests.Fakes.csproj b/test/Aliencube.AzureFunctions.Extensions.OpenApi.Tests.Fakes/Aliencube.AzureFunctions.Extensions.OpenApi.Tests.Fakes.csproj new file mode 100644 index 0000000..e24b463 --- /dev/null +++ b/test/Aliencube.AzureFunctions.Extensions.OpenApi.Tests.Fakes/Aliencube.AzureFunctions.Extensions.OpenApi.Tests.Fakes.csproj @@ -0,0 +1,17 @@ + + + + net461;netstandard2.0 + + + + + + + + + + + + + diff --git a/test/Aliencube.AzureFunctions.Extensions.OpenApi.Tests.Fakes/FakeEnum.cs b/test/Aliencube.AzureFunctions.Extensions.OpenApi.Tests.Fakes/FakeEnum.cs new file mode 100644 index 0000000..07ec118 --- /dev/null +++ b/test/Aliencube.AzureFunctions.Extensions.OpenApi.Tests.Fakes/FakeEnum.cs @@ -0,0 +1,15 @@ +using Aliencube.AzureFunctions.Extensions.OpenApi.Attributes; + +namespace Aliencube.AzureFunctions.Extensions.OpenApi.Tests.Fakes +{ + /// + /// This specifies fake enum values. + /// + public enum FakeEnum + { + Value1, + + [Display("lorem")] + Value2 + } +} diff --git a/test/Aliencube.AzureFunctions.Extensions.OpenApi.Tests.Fakes/FakeHttpTrigger.cs b/test/Aliencube.AzureFunctions.Extensions.OpenApi.Tests.Fakes/FakeHttpTrigger.cs new file mode 100644 index 0000000..4c72a04 --- /dev/null +++ b/test/Aliencube.AzureFunctions.Extensions.OpenApi.Tests.Fakes/FakeHttpTrigger.cs @@ -0,0 +1,48 @@ +#if NET461 +using System.Net; +using System.Net.Http; +#endif +using System.Threading.Tasks; + +#if !NET461 +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +#endif +using Microsoft.Azure.WebJobs; + +namespace Aliencube.AzureFunctions.Extensions.OpenApi.Tests.Fakes +{ + /// + /// This represents the fake class entity. + /// + public class FakeHttpTrigger + { +#if NET461 + /// + /// Gets something. + /// + /// instance. + /// Returns instance. + [FunctionName("FakeFunction")] + public async Task DoSomething( + [HttpTrigger] HttpRequestMessage req + ) + { + return await Task.FromResult(req.CreateResponse(HttpStatusCode.OK)).ConfigureAwait(false); + } +#else + /// + /// Gets something + /// + /// instance. + /// Returns instance. + [FunctionName("FakeFunction")] + public async Task DoSomething( + [HttpTrigger] HttpRequest req + ) + { + return await Task.FromResult(new OkResult()).ConfigureAwait(false); + } +#endif + } +} diff --git a/test/Aliencube.AzureFunctions.Extensions.OpenApi.Tests.Fakes/FakeModel.cs b/test/Aliencube.AzureFunctions.Extensions.OpenApi.Tests.Fakes/FakeModel.cs new file mode 100644 index 0000000..d48ae34 --- /dev/null +++ b/test/Aliencube.AzureFunctions.Extensions.OpenApi.Tests.Fakes/FakeModel.cs @@ -0,0 +1,37 @@ +using Newtonsoft.Json; + +namespace Aliencube.AzureFunctions.Extensions.OpenApi.Tests.Fakes +{ + /// + /// This represents the fake model entity. + /// + public class FakeModel + { + /// + /// Gets or sets the value. + /// + public string FakeProperty { get; set; } + + /// + /// Gets or sets the value 2. + /// + [JsonProperty("anotherFakeProperty")] + public string FakeProperty2 { get; set; } + + /// + /// Gets or sets the nullable int value. + /// + public int? NullableInt { get; set; } + + /// + /// Gets or sets the instance. + /// + public FakeSubModel SubProperty { get; set; } + + /// + /// Gets or sets the value. + /// + public FakeEnum EnumProperty { get; set; } + + } +} diff --git a/test/Aliencube.AzureFunctions.Extensions.OpenApi.Tests.Fakes/FakeModelWithCircularRef.cs b/test/Aliencube.AzureFunctions.Extensions.OpenApi.Tests.Fakes/FakeModelWithCircularRef.cs new file mode 100644 index 0000000..e915649 --- /dev/null +++ b/test/Aliencube.AzureFunctions.Extensions.OpenApi.Tests.Fakes/FakeModelWithCircularRef.cs @@ -0,0 +1,14 @@ +namespace Aliencube.AzureFunctions.Extensions.OpenApi.Tests.Fakes +{ + /// + /// This represents the fake model entity. + /// + public class FakeModelWithCircularRef + { + /// + /// Gets or sets the value. + /// + public string FakeProperty { get; set; } + public FakeModelWithCircularRefSub SubProperty { get; set; } + } +} diff --git a/test/Aliencube.AzureFunctions.Extensions.OpenApi.Tests.Fakes/FakeModelWithCircularRefSub.cs b/test/Aliencube.AzureFunctions.Extensions.OpenApi.Tests.Fakes/FakeModelWithCircularRefSub.cs new file mode 100644 index 0000000..5421bf7 --- /dev/null +++ b/test/Aliencube.AzureFunctions.Extensions.OpenApi.Tests.Fakes/FakeModelWithCircularRefSub.cs @@ -0,0 +1,13 @@ +namespace Aliencube.AzureFunctions.Extensions.OpenApi.Tests.Fakes +{ + /// + /// This represents the fake model entity. + /// + public class FakeModelWithCircularRefSub + { + /// + /// Gets or sets the value. + /// + public FakeModelWithCircularRef Circle { get; set; } + } +} diff --git a/test/Aliencube.AzureFunctions.Extensions.OpenApi.Tests.Fakes/FakeModelWithList.cs b/test/Aliencube.AzureFunctions.Extensions.OpenApi.Tests.Fakes/FakeModelWithList.cs new file mode 100644 index 0000000..11ad1f3 --- /dev/null +++ b/test/Aliencube.AzureFunctions.Extensions.OpenApi.Tests.Fakes/FakeModelWithList.cs @@ -0,0 +1,16 @@ +using System.Collections.Generic; + +namespace Aliencube.AzureFunctions.Extensions.OpenApi.Tests.Fakes +{ + /// + /// This represents the fake model entity. + /// + public class FakeModelWithList + { + /// + /// Gets or sets the value. + /// + public FakeSubModel Parent { get; set; } + public List Items { get; set; } + } +} diff --git a/test/Aliencube.AzureFunctions.Extensions.OpenApi.Tests.Fakes/FakeQueryCollection.cs b/test/Aliencube.AzureFunctions.Extensions.OpenApi.Tests.Fakes/FakeQueryCollection.cs new file mode 100644 index 0000000..dce4fad --- /dev/null +++ b/test/Aliencube.AzureFunctions.Extensions.OpenApi.Tests.Fakes/FakeQueryCollection.cs @@ -0,0 +1,48 @@ +using System.Collections; +using System.Collections.Generic; + +using Microsoft.AspNetCore.Http; +using Microsoft.Extensions.Primitives; + +namespace Aliencube.AzureFunctions.Extensions.OpenApi.Tests.Fakes +{ + public class FakeQueryCollection : IQueryCollection + { + private readonly Dictionary _values; + + public FakeQueryCollection() + { + this._values = new Dictionary(); + } + + public StringValues this[string key] + { + get { return this._values[key]; } + set { this._values[key] = value; } + } + + public int Count => throw new System.NotImplementedException(); + + public ICollection Keys => throw new System.NotImplementedException(); + + public bool ContainsKey(string key) + { + throw new System.NotImplementedException(); + } + + public IEnumerator> GetEnumerator() + { + throw new System.NotImplementedException(); + } + + public bool TryGetValue(string key, out StringValues value) + { + throw new System.NotImplementedException(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + throw new System.NotImplementedException(); + } + } +} \ No newline at end of file diff --git a/test/Aliencube.AzureFunctions.Extensions.OpenApi.Tests.Fakes/FakeSubModel.cs b/test/Aliencube.AzureFunctions.Extensions.OpenApi.Tests.Fakes/FakeSubModel.cs new file mode 100644 index 0000000..fab9515 --- /dev/null +++ b/test/Aliencube.AzureFunctions.Extensions.OpenApi.Tests.Fakes/FakeSubModel.cs @@ -0,0 +1,13 @@ +namespace Aliencube.AzureFunctions.Extensions.OpenApi.Tests.Fakes +{ + /// + /// This represents the fake model entity. + /// + public class FakeSubModel + { + /// + /// Gets or sets the value. + /// + public int FakeSubModelProperty { get; set; } + } +} diff --git a/test/Aliencube.AzureFunctions.Extensions.OpenApi.Tests.Fakes/IFakeBaseInterface.cs b/test/Aliencube.AzureFunctions.Extensions.OpenApi.Tests.Fakes/IFakeBaseInterface.cs new file mode 100644 index 0000000..13a6bf1 --- /dev/null +++ b/test/Aliencube.AzureFunctions.Extensions.OpenApi.Tests.Fakes/IFakeBaseInterface.cs @@ -0,0 +1,15 @@ +namespace Aliencube.AzureFunctions.Extensions.OpenApi.Tests.Fakes +{ + public interface IFakeBaseInterface + { + string Name { get; set; } + string City { get; set; } + + /// + /// Does something. + /// + /// Input value. + /// Output value. + bool DoSomething(bool input); + } +} \ No newline at end of file diff --git a/test/Aliencube.AzureFunctions.Extensions.OpenApi.Tests.Fakes/IFakeInheritedInterface.cs b/test/Aliencube.AzureFunctions.Extensions.OpenApi.Tests.Fakes/IFakeInheritedInterface.cs new file mode 100644 index 0000000..f21f7ca --- /dev/null +++ b/test/Aliencube.AzureFunctions.Extensions.OpenApi.Tests.Fakes/IFakeInheritedInterface.cs @@ -0,0 +1,10 @@ +using System; + +namespace Aliencube.AzureFunctions.Extensions.OpenApi.Tests.Fakes +{ + public interface IFakeInheritedInterface : IFakeBaseInterface + { + DateTime Birthdate { get; set; } + double Age { get; set; } + } +} \ No newline at end of file diff --git a/test/Aliencube.AzureFunctions.Extensions.OpenApi.Tests/Aliencube.AzureFunctions.Extensions.OpenApi.Tests.csproj b/test/Aliencube.AzureFunctions.Extensions.OpenApi.Tests/Aliencube.AzureFunctions.Extensions.OpenApi.Tests.csproj index 53965b4..77803dd 100644 --- a/test/Aliencube.AzureFunctions.Extensions.OpenApi.Tests/Aliencube.AzureFunctions.Extensions.OpenApi.Tests.csproj +++ b/test/Aliencube.AzureFunctions.Extensions.OpenApi.Tests/Aliencube.AzureFunctions.Extensions.OpenApi.Tests.csproj @@ -15,8 +15,7 @@ - - + diff --git a/test/Aliencube.AzureFunctions.Extensions.OpenApi.Tests/Extensions/EnumExtensionsTests.cs b/test/Aliencube.AzureFunctions.Extensions.OpenApi.Tests/Extensions/EnumExtensionsTests.cs index da70969..0e7166d 100644 --- a/test/Aliencube.AzureFunctions.Extensions.OpenApi.Tests/Extensions/EnumExtensionsTests.cs +++ b/test/Aliencube.AzureFunctions.Extensions.OpenApi.Tests/Extensions/EnumExtensionsTests.cs @@ -2,7 +2,7 @@ using Aliencube.AzureFunctions.Extensions.OpenApi.Enums; using Aliencube.AzureFunctions.Extensions.OpenApi.Extensions; -using Aliencube.AzureFunctions.Tests.Fakes; +using Aliencube.AzureFunctions.Extensions.OpenApi.Tests.Fakes; using FluentAssertions; diff --git a/test/Aliencube.AzureFunctions.Extensions.OpenApi.Tests/Extensions/MemberInfoExtensionsTests.cs b/test/Aliencube.AzureFunctions.Extensions.OpenApi.Tests/Extensions/MemberInfoExtensionsTests.cs index 072d18d..d6f3bd7 100644 --- a/test/Aliencube.AzureFunctions.Extensions.OpenApi.Tests/Extensions/MemberInfoExtensionsTests.cs +++ b/test/Aliencube.AzureFunctions.Extensions.OpenApi.Tests/Extensions/MemberInfoExtensionsTests.cs @@ -2,7 +2,7 @@ using System.Linq; using System.Reflection; -using Aliencube.AzureFunctions.Tests.Fakes; +using Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests.Fakes; using FluentAssertions; diff --git a/test/Aliencube.AzureFunctions.Extensions.OpenApi.Tests/Extensions/MethodInfoExtensionsTests.cs b/test/Aliencube.AzureFunctions.Extensions.OpenApi.Tests/Extensions/MethodInfoExtensionsTests.cs index 4701db5..4e980b2 100644 --- a/test/Aliencube.AzureFunctions.Extensions.OpenApi.Tests/Extensions/MethodInfoExtensionsTests.cs +++ b/test/Aliencube.AzureFunctions.Extensions.OpenApi.Tests/Extensions/MethodInfoExtensionsTests.cs @@ -1,7 +1,7 @@ using System; using System.Reflection; -using Aliencube.AzureFunctions.Tests.Fakes; +using Aliencube.AzureFunctions.Extensions.OpenApi.Tests.Fakes; using FluentAssertions; diff --git a/test/Aliencube.AzureFunctions.Extensions.OpenApi.Tests/Extensions/OpenApiSchemaExtensionsTests.cs b/test/Aliencube.AzureFunctions.Extensions.OpenApi.Tests/Extensions/OpenApiSchemaExtensionsTests.cs index 627626b..2566470 100644 --- a/test/Aliencube.AzureFunctions.Extensions.OpenApi.Tests/Extensions/OpenApiSchemaExtensionsTests.cs +++ b/test/Aliencube.AzureFunctions.Extensions.OpenApi.Tests/Extensions/OpenApiSchemaExtensionsTests.cs @@ -4,7 +4,7 @@ using Aliencube.AzureFunctions.Extensions.OpenApi.Attributes; using Aliencube.AzureFunctions.Extensions.OpenApi.Enums; using Aliencube.AzureFunctions.Extensions.OpenApi.Extensions; -using Aliencube.AzureFunctions.Tests.Fakes; +using Aliencube.AzureFunctions.Extensions.OpenApi.Tests.Fakes; using FluentAssertions; diff --git a/test/Aliencube.AzureFunctions.Extensions.OpenApi.Tests/Extensions/PropertyInfoExtensionsTests.cs b/test/Aliencube.AzureFunctions.Extensions.OpenApi.Tests/Extensions/PropertyInfoExtensionsTests.cs index 6770911..f459651 100644 --- a/test/Aliencube.AzureFunctions.Extensions.OpenApi.Tests/Extensions/PropertyInfoExtensionsTests.cs +++ b/test/Aliencube.AzureFunctions.Extensions.OpenApi.Tests/Extensions/PropertyInfoExtensionsTests.cs @@ -1,6 +1,6 @@ using System.Reflection; -using Aliencube.AzureFunctions.Tests.Fakes; +using Aliencube.AzureFunctions.Extensions.OpenApi.Tests.Fakes; using FluentAssertions; diff --git a/test/Aliencube.AzureFunctions.FunctionAppV2.Tests/Aliencube.AzureFunctions.FunctionAppV2.Tests.csproj b/test/Aliencube.AzureFunctions.FunctionAppV2.Tests/Aliencube.AzureFunctions.FunctionAppV2.Tests.csproj index f2e57b3..270667a 100644 --- a/test/Aliencube.AzureFunctions.FunctionAppV2.Tests/Aliencube.AzureFunctions.FunctionAppV2.Tests.csproj +++ b/test/Aliencube.AzureFunctions.FunctionAppV2.Tests/Aliencube.AzureFunctions.FunctionAppV2.Tests.csproj @@ -17,7 +17,7 @@ - + diff --git a/test/Aliencube.AzureFunctions.FunctionAppV2.Tests/SampleHttpTriggerTests.cs b/test/Aliencube.AzureFunctions.FunctionAppV2.Tests/SampleHttpTriggerTests.cs index ca7ddf9..4e1669e 100644 --- a/test/Aliencube.AzureFunctions.FunctionAppV2.Tests/SampleHttpTriggerTests.cs +++ b/test/Aliencube.AzureFunctions.FunctionAppV2.Tests/SampleHttpTriggerTests.cs @@ -1,8 +1,8 @@ using System.Threading.Tasks; using Aliencube.AzureFunctions.Extensions.DependencyInjection.Abstractions; +using Aliencube.AzureFunctions.Extensions.OpenApi.Tests.Fakes; using Aliencube.AzureFunctions.FunctionAppCommon.Functions; -using Aliencube.AzureFunctions.Tests.Fakes; using FluentAssertions;