public void AddFunctionShouldAddFunctionToEntry() { ODataResource entry = ReaderUtils.CreateNewResource(); Assert.Empty(entry.Functions); entry.AddFunction(new ODataFunction()); Assert.Single(entry.Functions); }
public void AddFunctionShouldAddFunctionToEntry() { ODataResource entry = ReaderUtils.CreateNewResource(); entry.Functions.Count().Should().Be(0); entry.AddFunction(new ODataFunction()); entry.Functions.Count().Should().Be(1); }
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"); }