Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
            }
        }
Exemplo n.º 3
0
        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);
            }
        }