public void duplicates_properties_in_db_map() { var entity = new IdentityServer4.EntityFramework.Entities.Client { Properties = new System.Collections.Generic.List <Entities.ClientProperty>() { new Entities.ClientProperty { Key = "foo1", Value = "bar1" }, new Entities.ClientProperty { Key = "foo1", Value = "bar2" }, } }; Action modelAction = () => entity.ToModel(); modelAction.ShouldThrow <Exception>(); }
public void missing_values_should_use_defaults() { var entity = new IdentityServer4.EntityFramework.Entities.Client { ClientSecrets = new System.Collections.Generic.List <Entities.ClientSecret> { new 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); }