コード例 #1
0
        public void SetIssuer_AddressIsReplaced()
        {
            // Arrange
            var services = CreateServices();
            var builder  = new OpenIddictBuilder(services);

            // Act
            builder.SetIssuer(new Uri("http://www.fabrikam.com/"));

            var options = GetOptions(services);

            // Assert
            Assert.Equal(new Uri("http://www.fabrikam.com/"), options.Issuer);
        }
コード例 #2
0
        public void SetIssuer_AddressIsReplaced()
        {
            // Arrange
            var services = new ServiceCollection();

            services.AddOptions();

            var builder = new OpenIddictBuilder(services);

            // Act
            builder.SetIssuer(new Uri("http://www.fabrikam.com/"));

            var provider = services.BuildServiceProvider();
            var options  = provider.GetRequiredService <IOptions <OpenIddictOptions> >();

            // Assert
            Assert.Equal(new Uri("http://www.fabrikam.com/"), options.Value.Issuer);
        }