Beispiel #1
0
        public void AddFunctionShouldAddFunctionToEntry()
        {
            ODataResource entry = ReaderUtils.CreateNewResource();

            Assert.Empty(entry.Functions);
            entry.AddFunction(new ODataFunction());
            Assert.Single(entry.Functions);
        }
Beispiel #2
0
        public void AddFunctionShouldAddFunctionToEntry()
        {
            ODataResource entry = ReaderUtils.CreateNewResource();

            entry.Functions.Count().Should().Be(0);
            entry.AddFunction(new ODataFunction());
            entry.Functions.Count().Should().Be(1);
        }
Beispiel #3
0
        public ODataMissingOperationGeneratorTests()
        {
            this.model               = new EdmModel();
            this.container           = new EdmEntityContainer("Fake", "Container");
            this.functionEdmMetadata = new EdmFunction("Fake", "FakeFunction", EdmCoreModel.Instance.GetInt32(false), true /*isBound*/, null, true /*isComposable*/);
            this.actionEdmMetadata   = new EdmAction("Fake", "FakeAction", EdmCoreModel.Instance.GetInt32(false), true /*isBound*/, null /*entitySetPath*/);
            this.model.AddElement(this.container);
            this.model.AddElement(this.actionEdmMetadata);
            this.model.AddElement(this.functionEdmMetadata);

            this.allOperations = new EdmOperation[] { this.actionEdmMetadata, this.functionEdmMetadata };

            this.odataAction = new ODataAction {
                Metadata = new Uri("http://temp.org/$metadata#Fake.FakeAction")
            };
            this.odataFunction = new ODataFunction {
                Metadata = new Uri("http://temp.org/$metadata#Fake.FakeFunction")
            };

            this.entry      = ReaderUtils.CreateNewResource();
            this.entityType = new EdmEntityType("TestNamespace", "EntityType");
        }