private static DeviceCodeAuthenticationProvider PrepareDeviceCodeAuthenticationProvider() { var configuration = TestCommon.GetConfigurationSettings(); var clientId = configuration.GetValue <string>($"{TestGlobals.CredentialsConfigurationBasePath}:{deviceCodeConfigurationPath}:ClientId"); var tenantId = configuration.GetValue <string>($"{TestGlobals.CredentialsConfigurationBasePath}:{deviceCodeConfigurationPath}:TenantId"); var redirectUri = configuration.GetValue <Uri>($"{TestGlobals.CredentialsConfigurationBasePath}:{deviceCodeConfigurationPath}:DeviceCode:RedirectUri"); var provider = new DeviceCodeAuthenticationProvider( clientId, tenantId, redirectUri, DeviceCodeVerificationCallback); return(provider); }
#pragma warning disable CS1998 // Async method lacks 'await' operators and will run synchronously public async Task TestDeviceCodeConstructorNoDI_NullRedirectUri() #pragma warning restore CS1998 // Async method lacks 'await' operators and will run synchronously { var configuration = TestCommon.GetConfigurationSettings(); var clientId = configuration.GetValue <string>($"{TestGlobals.CredentialsConfigurationBasePath}:{deviceCodeConfigurationPath}:ClientId"); var tenantId = configuration.GetValue <string>($"{TestGlobals.CredentialsConfigurationBasePath}:{deviceCodeConfigurationPath}:TenantId"); var provider = new DeviceCodeAuthenticationProvider( clientId, tenantId, redirectUri: null, n => { }); // Fake notification, we don't care of it in this test Assert.IsNotNull(provider); Assert.IsNotNull(provider.ClientId); Assert.IsNotNull(provider.TenantId); Assert.IsNotNull(provider.RedirectUri); Assert.IsNotNull(provider.DeviceCodeVerification); }