Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
pmaytak committed Jun 25, 2020
1 parent f2b1b6e commit b432033
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/Microsoft.Identity.Web/Microsoft.Identity.Web.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public static AuthenticationBuilder AddMicrosoftWebApiCallsWebApi(
}

/// <summary>
/// Protects the web API with Microsoft identity platform (formerly Azure AD v2.0)
/// Protects the web API with Microsoft identity platform (formerly Azure AD v2.0).
/// </summary>
/// <param name="builder">The <see cref="AuthenticationBuilder"/> to which to add this configuration.</param>
/// <param name="configureConfidentialClientApplicationOptions">The action to configure <see cref="ConfidentialClientApplicationOptions"/>.</param>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
<DefineConstants>$(DefineConstants);DOTNET_CORE_31</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'net5.0'">
<DefineConstants>$(DefineConstants);DOTNET_50</DefineConstants>
</PropertyGroup>

<PropertyGroup>
<TargetFrameworks>netcoreapp3.1; net5.0</TargetFrameworks>
Expand Down
5 changes: 5 additions & 0 deletions tests/Microsoft.Identity.Web.Test/WebAppExtensionsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@ public void AddMicrosoftWebApp_WithConfigActionParameters(bool subscribeToDiagno
var configuredOidcOptions = provider.GetServices<IConfigureOptions<OpenIdConnectOptions>>().Cast<ConfigureNamedOptions<OpenIdConnectOptions>>();
var configuredMsOptions = provider.GetServices<IConfigureOptions<MicrosoftIdentityOptions>>().Cast<ConfigureNamedOptions<MicrosoftIdentityOptions>>();

#if DOTNET_CORE_31
var configuredCookieOptions = provider.GetServices<IConfigureOptions<CookieAuthenticationOptions>>().Cast<ConfigureNamedOptions<CookieAuthenticationOptions>>();
Assert.Contains(configuredCookieOptions, o => o.Action == _configureCookieOptions);
#endif

Assert.Contains(configuredOidcOptions, o => o.Action == _configureOidcOptions);
Assert.Contains(configuredMsOptions, o => o.Action == _configureMsOptions);

Expand Down

0 comments on commit b432033

Please sign in to comment.