diff --git a/.github/pipelines/dotnet-build.yml b/.github/pipelines/dotnet-build.yml new file mode 100644 index 00000000..9a1921ad --- /dev/null +++ b/.github/pipelines/dotnet-build.yml @@ -0,0 +1,20 @@ +# .NET Build + +parameters: + - name: BuildConfiguration + type: string + default: $(BuildConfiguration) + - name: BuildParameters + type: string + - name: BuildPlatform + type: string +steps: + - template: /.github/pipelines/dotnet-initialize.yml@self + parameters: + BuildConfiguration: ${{parameters.BuildConfiguration}} + BuildParameters: Platform="${{parameters.BuildPlatform}}" + - task: DotNetCoreCLI@2 + displayName: dotnet build + inputs: + projects: "**\\*.sln" + arguments: -c ${{parameters.BuildConfiguration}} -p:${{parameters.BuildParameters}} --no-restore diff --git a/.github/pipelines/dotnet-buildandtest.yml b/.github/pipelines/dotnet-buildandtest.yml new file mode 100644 index 00000000..a98eef73 --- /dev/null +++ b/.github/pipelines/dotnet-buildandtest.yml @@ -0,0 +1,26 @@ +# .NET Build and Tests + +parameters: +- name: BuildConfiguration + type: string + default: $(BuildConfiguration) +- name: BuildParameters + type: string + default: Platform="$(BuildPlatform)" +- name: BuildPlatform + type: string +- name: TestFilter + type: string + default: FullyQualifiedName!~CloudTests +steps: +- template: /.github/pipelines/dotnet-build.yml@self + parameters: + BuildConfiguration: ${{parameters.BuildConfiguration}} + BuildParameters: ${{parameters.BuildParameters}} + BuildPlatform: ${{parameters.BuildPlatform}} +- template: /.github/pipelines/dotnet-tests.yml@self + parameters: + BuildConfiguration: ${{parameters.BuildConfiguration}} + BuildParameters: ${{parameters.BuildParameters}} + BuildPlatform: ${{parameters.BuildPlatform}} + TestFilter: ${{parameters.TestFilter}} diff --git a/.github/pipelines/dotnet-initialize.yml b/.github/pipelines/dotnet-initialize.yml new file mode 100644 index 00000000..bfc7d55c --- /dev/null +++ b/.github/pipelines/dotnet-initialize.yml @@ -0,0 +1,24 @@ +# .Net Initialization + +parameters: + - name: BuildConfiguration + type: string + default: $(BuildConfiguration) + - name: BuildParameters + type: string + default: Platform="$(BuildPlatform)" +steps: + - task: NuGetAuthenticate@1 + displayName: NuGet Authenticate + - task: UseDotNet@2 + displayName: Use .NET SDK from global.json + inputs: + useGlobalJson: true + - task: DotNetCoreCLI@2 + displayName: dotnet restore + inputs: + command: restore + projects: "**\\*.sln" + restoreArguments: /p:Configuration="${{parameters.BuildConfiguration}}" -p:${{parameters.BuildParameters}} + feedRestore: Office + includeNuGetOrg: false diff --git a/.github/pipelines/dotnet-tests.yml b/.github/pipelines/dotnet-tests.yml new file mode 100644 index 00000000..c77dab86 --- /dev/null +++ b/.github/pipelines/dotnet-tests.yml @@ -0,0 +1,61 @@ +# .NET UnitTests + +parameters: + - name: BuildConfiguration + type: string + default: $(BuildConfiguration) + - name: BuildParameters + type: string + - name: BuildPlatform + type: string + default: $(BuildPlatform) + - name: TestFilter + type: string + default: FullyQualifiedName!~CloudTests +steps: + - task: PowerShell@2 + displayName: run dotnet test (workaround azure-pipelines-tasks/issues/18731) + inputs: + targetType: inline + script: |+ + $buildDirectory = "$(Agent.BuildDirectory)\s\" + Write-Host "Searching for solution file in build directory: $buildDirectory" + + # Identify solution file to target + $slnFile = (Get-ChildItem -Path $buildDirectory -Filter "*.sln").Name + + Write-Host "Running dotnet test with code coverage enabled" + # Merge all streams into stdout + $result = C:\hostedtoolcache\windows\dotnet\dotnet.exe test $slnFile --collect "Code coverage" --logger trx --results-directory D:\a\_work\_temp -c Release -p:Platform=x64 --no-build --no-restore --filter FullyQualifiedName!~CloudTests --verbosity Detailed *>&1 + + # Write output + $output = $result -join [System.Environment]::NewLine + Write-Host $output + + if($LASTEXITCODE -eq 0) + { + # Success + } + else + { + $LASTEXITCODE = 0 + Write-Warning "Running dotnet test with code coverage enabled failed. Retrying with code coverage collection disabled." + $result = C:\hostedtoolcache\windows\dotnet\dotnet.exe test $slnFile --logger trx --results-directory D:\a\_work\_temp -c Release -p:Platform=x64 --no-build --no-restore --filter FullyQualifiedName!~CloudTests --verbosity Detailed *>&1 + + # Write output + $output = $result -join [System.Environment]::NewLine + Write-Host $output + } + + + + - task: PublishTestResults@2 + displayName: Publish Test Results $(Agent.TempDirectory)\**\*.trx + condition: succeededOrFailed() + inputs: + testRunner: VSTest + testResultsFiles: $(Agent.TempDirectory)\**\*.trx + searchFolder: $(Common.TestResultsDirectory) + mergeTestResults: true + platform: ${{parameters.BuildPlatform}} + configuration: ${{parameters.BuildConfiguration}} diff --git a/.github/pipelines/omex-github-official.yml b/.github/pipelines/omex-github-official.yml new file mode 100644 index 00000000..8aaf9773 --- /dev/null +++ b/.github/pipelines/omex-github-official.yml @@ -0,0 +1,276 @@ +# OMEX GitHub Official Pipeline +name: $(date:yyyyMMddHHmmss) +variables: +- name: BuildConfiguration + value: Release +- name: BuildPlatform + value: Any CPU +- name: CodeQL.Enabled + value: true +- name: DisableCfsDetector + value: true +- name: guardianbaselineupdated + value: "20211002" +- name: system.debug + value: false +- name: tags + value: production, multi-phased, externalfacing +schedules: +- cron: 0 20 * * 0 + branches: + include: + - refs/heads/main + always: true +resources: + repositories: + - repository: OfficePipelineTemplates + type: git + name: OE/OfficePipelineTemplates + ref: refs/heads/main +pr: none +trigger: + branches: + include: + - refs/heads/main + - refs/heads/release +extends: + template: v1/Office.Official.PipelineTemplate.yml@OfficePipelineTemplates + parameters: + pool: + name: Azure-Pipelines-1ESPT-ExDShared + image: windows-2022 + os: windows + customBuildTags: + - ES365AIMigrationTooling + stages: + - stage: Stage + jobs: + - job: Job_1 + displayName: Build + templateContext: + outputs: + - output: pipelineArtifact + artifactName: binaries + targetPath: bin + displayName: Publish Binaries + steps: + - checkout: self + clean: true + fetchDepth: 1 + persistCredentials: true + - template: /.github/pipelines/dotnet-build.yml@self + parameters: + BuildParameters: Platform="$(BuildPlatform)";SignAssemblies=true;UseVstsSourceLink=true;CommitSha=$(Build.SourceVersion) + BuildPlatform: $(BuildPlatform) + - task: mspremier.BuildQualityChecks.QualityChecks-task.BuildQualityChecks@6 + displayName: Check build quality + inputs: + checkWarnings: true + warningFailOption: fixed + warningTaskFilters: /^(((android|xcode|gradlew)\s+)?build|ant|maven|cmake|gulp)/i + - task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0 + displayName: "Manifest Generator " + inputs: + BuildDropPath: bin + - job: Job_6 + displayName: Validation + dependsOn: Job_1 + steps: + - checkout: self + clean: true + fetchDepth: 1 + persistCredentials: true + - task: DownloadPipelineArtifact@0 + displayName: Download Binaries + inputs: + artifactName: binaries + targetPath: bin + - template: /.github/pipelines/dotnet-initialize.yml@self + - template: /.github/pipelines/dotnet-tests.yml@self + parameters: + BuildParameters: Platform="$(BuildPlatform)" + - job: Job_2 + displayName: Code Sign + dependsOn: Job_1 + templateContext: + outputs: + - output: pipelineArtifact + artifactName: binaries_signed + targetPath: bin + displayName: Publish Binaries + steps: + - checkout: self + clean: true + fetchDepth: 1 + - task: DownloadPipelineArtifact@0 + displayName: Download Binaries + inputs: + artifactName: binaries + targetPath: bin + - task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@3 + displayName: ESRP CodeSigning OSS + inputs: + ConnectedServiceName: OmexOpenSourceESRP + FolderPath: $(Build.Repository.LocalPath)\bin + Pattern: Microsoft.Omex*.dll,Microsoft.Omex*.exe + signConfigType: inlineSignParams + inlineOperation: | + [ + { + "KeyCode" : "CP-231522", + "OperationCode" : "SigntoolSign", + "Parameters" : { + "OpusName" : "Microsoft", + "OpusInfo" : "http://www.microsoft.com", + "FileDigest" : "/fd \"SHA256\"", + "PageHash" : "/NPH", + "TimeStamp" : "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256" + }, + "ToolName" : "sign", + "ToolVersion" : "1.0" + }, + { + "KeyCode" : "CP-231522", + "OperationCode" : "SigntoolVerify", + "Parameters" : {}, + "ToolName" : "sign", + "ToolVersion" : "1.0" + } + ] + - job: Job_3 + displayName: Pack + dependsOn: + - Job_2 + - Job_6 + templateContext: + outputs: + - output: pipelineArtifact + artifactName: unsigned_nuget + targetPath: $(Build.ArtifactStagingDirectory)/UnsignedNuget + displayName: Upload NuGet Packages For Signing + - output: nuget + displayName: NuGet push to Office + condition: and(succeeded(), ne(variables['Build.SourceBranch'], 'refs/heads/release')) + publishVstsFeed: 86ec7889-a365-4cd1-90df-6e18cc2ea59f + packagesToPush: $(Build.ArtifactStagingDirectory)/Office/**/*.nupkg;!$(Build.ArtifactStagingDirectory)/**/*.snupkg;!$(Build.ArtifactStagingDirectory)/**/*.symbols.nupkg + packageParentPath: $(Build.ArtifactStagingDirectory) + allowPackageConflicts: true + publishPackageMetadata: false + steps: + - checkout: self + clean: true + fetchDepth: 1 + persistCredentials: true + - task: DownloadPipelineArtifact@0 + displayName: Download Binaries + inputs: + artifactName: binaries_signed + targetPath: bin + - template: /.github/pipelines/dotnet-initialize.yml@self + - task: DotNetCoreCLI@2 + displayName: dotnet pack pre-release build + condition: and(succeeded(), ne(variables['Build.SourceBranch'], 'refs/heads/release')) + inputs: + command: pack + searchPatternPack: "**/*.sln" + configurationToPack: Release + outputDir: $(Build.ArtifactStagingDirectory)/UnsignedNuget + nobuild: true + buildProperties: PreReleaseSuffix=$(Build.BuildNumber);IsReleaseBuild=false + - task: DotNetCoreCLI@2 + displayName: dotnet pack release build + condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/release')) + inputs: + command: pack + searchPatternPack: "**/*.sln" + configurationToPack: Release + outputDir: $(Build.ArtifactStagingDirectory)/UnsignedNuget + nobuild: true + buildProperties: PreReleaseSuffix=$(Build.BuildNumber);IsReleaseBuild=true + - task: oenginternal.office-vsts-tasks-extension.918cfcff-ee9e-48b9-896b-da6d2df26b33.SetVSTSBuildVersion@2 + displayName: Set VSTS Build Version + condition: and(succeeded(), ne(variables['Build.SourceBranch'], 'refs/heads/release')) + inputs: + OfficialReleaseBranch: refs/heads/main + OfficialReleaseTypeNumber: "4" + - task: DotNetCoreCLI@2 + displayName: dotnet pack for Office + condition: and(succeeded(), ne(variables['Build.SourceBranch'], 'refs/heads/release')) + inputs: + command: pack + searchPatternPack: "**/*.sln" + configurationToPack: Release + outputDir: $(Build.ArtifactStagingDirectory)/Office + nobuild: true + versioningScheme: byBuildNumber + buildProperties: PreReleaseSuffix=$(Build.BuildNumber);IsReleaseBuild=false;IsInternalBuild=false + - job: Job_4 + displayName: Sign NuGet packages + dependsOn: Job_3 + templateContext: + outputs: + - output: pipelineArtifact + artifactName: signed_nuget_packages + targetPath: $(Build.ArtifactStagingDirectory)/UnsignedNuget + displayName: Publish Pipeline Artifact + steps: + - checkout: self + clean: true + fetchDepth: 1 + persistCredentials: true + - task: DownloadPipelineArtifact@0 + displayName: Download Unsigned NuGet Packages + inputs: + artifactName: unsigned_nuget + targetPath: $(Build.ArtifactStagingDirectory)/UnsignedNuget + - task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@2 + displayName: ESRP CodeSigning + inputs: + ConnectedServiceName: OmexOpenSourceESRP + FolderPath: $(Build.ArtifactStagingDirectory)/UnsignedNuget + Pattern: Microsoft.Omex*.nupkg + signConfigType: inlineSignParams + inlineOperation: |- + [ + { + "keyCode": "CP-401405", + "operationSetCode": "NuGetSign", + "parameters": [ ], + "toolName": "sign", + "toolVersion": "1.0" + }, + { + "keyCode": "CP-401405", + "operationSetCode": "NuGetVerify", + "parameters": [ ], + "toolName": "sign", + "toolVersion": "1.0" + } + ] + - job: Job_5 + displayName: Release + dependsOn: Job_4 + templateContext: + outputs: + - output: nuget + displayName: NuGet push to NuGet.org + condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/release')) + nuGetFeedType: external + packagesToPush: $(Build.ArtifactStagingDirectory)/SignedNuGet/**/*.nupkg;!$(Build.ArtifactStagingDirectory)/SignedNuGet/**/*.snupkg;!$(Build.ArtifactStagingDirectory)/**/*.symbols.nupkg + packageParentPath: $(Build.ArtifactStagingDirectory) + publishFeedCredentials: Omex NuGet.org + steps: + - checkout: self + clean: true + fetchDepth: 1 + persistCredentials: true + - task: DownloadPipelineArtifact@0 + displayName: Download Signed NuGet Packages + condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/release')) + inputs: + artifactName: signed_nuget_packages + targetPath: $(Build.ArtifactStagingDirectory)/SignedNuget + - task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0 + displayName: "Manifest Generator " + inputs: + BuildDropPath: $(Build.ArtifactStagingDirectory) diff --git a/.github/pipelines/omex-github-pullrequest.yml b/.github/pipelines/omex-github-pullrequest.yml new file mode 100644 index 00000000..4ae8aab8 --- /dev/null +++ b/.github/pipelines/omex-github-pullrequest.yml @@ -0,0 +1,66 @@ +# OMEX GitHub PullRequest Pipeline + +name: $(date:yyyyMMdd)$(rev:.r) +variables: +- name: BuildConfiguration + value: release +- name: BuildPlatform + value: Any CPU +- name: DisableCfsDetector + value: true +- name: system.debug + value: false +resources: + repositories: + - repository: OfficePipelineTemplates + type: git + name: OE/OfficePipelineTemplates + ref: refs/heads/main +pr: +- main +trigger: none +extends: + template: v1/Office.Unofficial.PipelineTemplate.yml@OfficePipelineTemplates + parameters: + pool: + os: windows + image: windows-2022 + name: Azure-Pipelines-1ESPT-ExDShared + customBuildTags: + - ES365AIMigrationTooling + stages: + - stage: Stage + jobs: + - job: Job_1 + displayName: Pull Request Validation + steps: + - checkout: self + clean: true + persistCredentials: true + - template: /.github/pipelines/dotnet-buildandtest.yml@self + parameters: + BuildPlatform: $(BuildPlatform) + - task: DotNetCoreCLI@2 + displayName: dotnet pack pre-release build + condition: and(succeeded(), ne(variables['Build.SourceBranch'], 'refs/heads/release')) + inputs: + command: pack + searchPatternPack: "**/*.sln" + configurationToPack: Release + nobuild: true + buildProperties: PreReleaseSuffix=$(Build.BuildNumber);IsReleaseBuild=false + - task: DotNetCoreCLI@2 + displayName: dotnet pack release build + condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/release')) + inputs: + command: pack + searchPatternPack: "**/*.sln" + configurationToPack: Release + nobuild: true + buildProperties: PreReleaseSuffix=$(Build.BuildNumber);IsReleaseBuild=true + - task: mspremier.BuildQualityChecks.QualityChecks-task.BuildQualityChecks@6 + displayName: Check build quality + inputs: + checkWarnings: true + warningFailOption: fixed + warningTaskFilters: /^(((android|xcode|gradlew)\s+)?build|ant|maven|cmake|gulp)/i diff --git a/src/Activities/Microsoft.Omex.Extensions.Activities.csproj b/src/Activities/Microsoft.Omex.Extensions.Activities.csproj index 07090e8a..0b3f5c77 100644 --- a/src/Activities/Microsoft.Omex.Extensions.Activities.csproj +++ b/src/Activities/Microsoft.Omex.Extensions.Activities.csproj @@ -12,6 +12,7 @@ Microsoft;Omex;Extensions;Activities + diff --git a/src/Activities/Option/ActivityOption.cs b/src/Activities/Option/ActivityOption.cs index 49f5679e..60ce4b24 100644 --- a/src/Activities/Option/ActivityOption.cs +++ b/src/Activities/Option/ActivityOption.cs @@ -6,7 +6,7 @@ namespace Microsoft.Omex.Extensions.Activities /// /// Monitoring option /// - public class ActivityOption + internal class ActivityOption { /// /// Path to the setting diff --git a/src/Activities/ServiceCollectionExtensions.cs b/src/Activities/ServiceCollectionExtensions.cs index a0f14de5..59a855a0 100644 --- a/src/Activities/ServiceCollectionExtensions.cs +++ b/src/Activities/ServiceCollectionExtensions.cs @@ -45,7 +45,8 @@ public static IServiceCollection AddOmexActivitySource(this IServiceCollection s serviceCollection .AddOptions() .BindConfiguration(ActivityOption.MonitoringPath) - .ValidateDataAnnotations(); + .ValidateDataAnnotations() + .ValidateOnStart(); serviceCollection.TryAddSingleton(); serviceCollection.TryAddSingleton(p => new ActivitySource(ActivitySourceName, ActivitySourceVersion)); diff --git a/src/Hosting.Services/HostBuilderExtensions.cs b/src/Hosting.Services/HostBuilderExtensions.cs index 9990d544..f568e86d 100644 --- a/src/Hosting.Services/HostBuilderExtensions.cs +++ b/src/Hosting.Services/HostBuilderExtensions.cs @@ -101,6 +101,7 @@ private static IHost BuildServiceFabricService( options.ValidateOnBuild = true; options.ValidateScopes = true; }) + .ConfigureLogging(builder => builder.AddOmexLogging()) .Build(); InitializationLogger.LogInitializationSucceed(serviceNameForLogging); diff --git a/src/Logging/Internal/OmexLoggerProvider.cs b/src/Logging/Internal/OmexLoggerProvider.cs index db37bd43..17190655 100644 --- a/src/Logging/Internal/OmexLoggerProvider.cs +++ b/src/Logging/Internal/OmexLoggerProvider.cs @@ -8,6 +8,7 @@ namespace Microsoft.Omex.Extensions.Logging { + [ProviderAlias("Omex")] internal class OmexLoggerProvider : ILoggerProvider, ISupportExternalScope { public OmexLoggerProvider( @@ -18,8 +19,8 @@ public OmexLoggerProvider( { m_logsEventSender = logsEventSender; m_defaultExternalScopeProvider = defaultExternalScopeProvider; - m_replayer = replayer; m_textScrubbers = textScrubbers; + m_replayer = replayer; } public ILogger CreateLogger(string categoryName) => @@ -30,9 +31,10 @@ public void Dispose() { } public void SetScopeProvider(IExternalScopeProvider scopeProvider) => m_externalScopeProvider = scopeProvider; private IExternalScopeProvider? m_externalScopeProvider; + + private readonly ILogEventSender m_logsEventSender; private readonly IExternalScopeProvider m_defaultExternalScopeProvider; private readonly IEnumerable m_textScrubbers; private readonly ILogEventReplayer? m_replayer; - private readonly ILogEventSender m_logsEventSender; } } diff --git a/src/Logging/OmexLoggingOptions.cs b/src/Logging/OmexLoggingOptions.cs index 16f30d3a..140fb2df 100644 --- a/src/Logging/OmexLoggingOptions.cs +++ b/src/Logging/OmexLoggingOptions.cs @@ -6,7 +6,7 @@ namespace Microsoft.Omex.Extensions.Logging /// /// Options for Omex logger /// - public class OmexLoggingOptions + internal class OmexLoggingOptions { /// /// Should logs wrapped by the Activity be stored and replayed at a higher severity, in the event of an error. diff --git a/src/Logging/ServiceCollectionExtensions.cs b/src/Logging/ServiceCollectionExtensions.cs index b9bdefbc..1543ee39 100644 --- a/src/Logging/ServiceCollectionExtensions.cs +++ b/src/Logging/ServiceCollectionExtensions.cs @@ -4,6 +4,7 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Logging.Configuration; using Microsoft.Omex.Extensions.Abstractions.Activities.Processing; using Microsoft.Omex.Extensions.Abstractions.ExecutionContext; using Microsoft.Omex.Extensions.Logging.Replayable; @@ -31,6 +32,7 @@ public static IServiceCollection AddOmexServiceContext(this ISe /// The extension method argument public static ILoggingBuilder AddOmexLogging(this ILoggingBuilder builder) { + builder.AddConfiguration(); builder.Services.AddOmexLogging(); return builder; } diff --git a/tests/Activities.UnitTests/ServiceCollectionTests.cs b/tests/Activities.UnitTests/ServiceCollectionTests.cs index bbc0e240..b5cd0aa4 100644 --- a/tests/Activities.UnitTests/ServiceCollectionTests.cs +++ b/tests/Activities.UnitTests/ServiceCollectionTests.cs @@ -32,11 +32,10 @@ public void AddOmexActivitySource_TypesRegistered(Type typeToResolve, Type imple } [TestMethod] - public void AddOmexActivitySource_HostedServicesRegiestered() + public void AddOmexActivitySource_HostedServicesRegistered() { Type[] types = GetRegisteredServices(); - Assert.AreEqual(2, types.Length); CollectionAssert.Contains(types, typeof(ActivityListenerInitializerService)); CollectionAssert.Contains(types, typeof(DiagnosticsObserversInitializer)); } @@ -47,7 +46,7 @@ public void AddOmexActivitySource_ActivityCreationEnabled() Task task = CreateHost().RunAsync(); Activity? activity = new ActivitySource("Source") - .StartActivity(nameof(AddOmexActivitySource_HostedServicesRegiestered)); + .StartActivity(nameof(AddOmexActivitySource_HostedServicesRegistered)); NullableAssert.IsNotNull(activity, "Activity creation enabled after host started"); } diff --git a/tests/Hosting.Services.UnitTests/HostBuilderExtensionsTests.cs b/tests/Hosting.Services.UnitTests/HostBuilderExtensionsTests.cs index 3cc04aa9..25b608e0 100644 --- a/tests/Hosting.Services.UnitTests/HostBuilderExtensionsTests.cs +++ b/tests/Hosting.Services.UnitTests/HostBuilderExtensionsTests.cs @@ -25,7 +25,7 @@ public class HostBuilderExtensionsTests [DataRow(typeof(IExecutionContext), typeof(ServiceFabricExecutionContext))] [DataRow(typeof(ActivitySource), null)] [DataRow(typeof(ILogger), null)] - public void AddOmexServiceFabricDependencies_TypesRegistered(Type typeToResolver, Type? expectedImplementationType) + public void AddOmexServiceFabricDependencies_TypesRegistered(Type typeToResolve, Type? expectedImplementationType) { void CheckTypeRegistration() where TContext : ServiceContext { @@ -33,7 +33,7 @@ void CheckTypeRegistration() where TContext : ServiceContext .AddOmexServiceFabricDependencies() .AddSingleton(new Mock().Object) .BuildServiceProvider() - .GetService(typeToResolver); + .GetService(typeToResolve); Assert.IsNotNull(obj, "Failed to resolve for {0}", typeof(TContext));