public void CalculateBindableOperationsForDerivedEntityTypeWithTypeResolver() { var bindingType = this.model.FindType("TestModel.TVMovie"); var bindableOperations = MetadataUtils.CalculateBindableOperationsForType(bindingType, this.model, new EdmTypeReaderResolver(this.model, ODataReaderBehavior.CreateWcfDataServicesClientBehavior(this.NameToTypeResolver))); Assert.Equal(2, bindableOperations.Length); Assert.True(bindableOperations.Count(o => o.Name == "Rate") == 1); Assert.True(bindableOperations.Count(o => o.Name == "ChangeChannel") == 1); }
public void CalculateBindableOperationsForEntityCollectionTypeWithTypeResolver() { var bindingType = new EdmCollectionType(this.model.FindType("TestModel.Movie").ToTypeReference(nullable: false)); var bindableOperations = MetadataUtils.CalculateBindableOperationsForType(bindingType, this.model, new EdmTypeReaderResolver(this.model, ODataReaderBehavior.CreateWcfDataServicesClientBehavior(this.NameToTypeResolver))); Assert.Equal(2, bindableOperations.Length); foreach (var operation in bindableOperations) { Assert.Equal("RateMultiple", operation.Name); } }
public void CalculateBindableOperationsForEntityTypeWithTypeResolver() { var bindingType = this.model.FindType("TestModel.Movie"); var bindableOperations = MetadataUtils.CalculateBindableOperationsForType(bindingType, this.model, new EdmTypeReaderResolver(this.model, ODataReaderBehavior.CreateWcfDataServicesClientBehavior(this.NameToTypeResolver))); Assert.AreEqual(1, bindableOperations.Length); foreach (var operation in bindableOperations) { Assert.AreEqual("Rate", operation.Name); } }