Ejemplo n.º 1
0
        public void duplicates_properties_in_db_map()
        {
            var entity = new IdentityServer4.Fsql.Storage.Entities.Client
            {
                Properties = new System.Collections.Generic.List <IdentityServer4.Fsql.Storage.Entities.ClientProperty>()
                {
                    new IdentityServer4.Fsql.Storage.Entities.ClientProperty {
                        Key = "foo1", Value = "bar1"
                    },
                    new IdentityServer4.Fsql.Storage.Entities.ClientProperty {
                        Key = "foo1", Value = "bar2"
                    },
                }
            };

            Action modelAction = () => entity.ToModel();

            modelAction.Should().Throw <Exception>();
        }
Ejemplo n.º 2
0
        public void missing_values_should_use_defaults()
        {
            var entity = new IdentityServer4.Fsql.Storage.Entities.Client
            {
                ClientSecrets = new System.Collections.Generic.List <IdentityServer4.Fsql.Storage.Entities.ClientSecret>
                {
                    new IdentityServer4.Fsql.Storage.Entities.ClientSecret
                    {
                    }
                }
            };

            var def = new Client
            {
                ClientSecrets = { new Models.Secret("foo") }
            };

            var model = entity.ToModel();

            model.ProtocolType.Should().Be(def.ProtocolType);
            model.ClientSecrets.First().Type.Should().Be(def.ClientSecrets.First().Type);
        }