public void SettingStringKeyToInvalidPropertyShouldThrowException() { //arrange var target = new ModelBuilder(); //act RestTypeConfiguration <Foo> restTypeConfiguration = target.Entity <Foo>(); Action act = () => restTypeConfiguration.WithKey("id"); //assert act.ShouldThrow <InvalidOperationException>(); }
public void SettingStringKeyShouldPopulateKeySelector() { //arrange var target = new ModelBuilder(); //act RestTypeConfiguration <Foo> restTypeConfiguration = target.Entity <Foo>(); IRestTypeDefinition typeDefinition = (IRestTypeDefinition)restTypeConfiguration.WithKey("Id"); ; //assert Assert.IsNotNull(typeDefinition.KeyProperty); }