Ejemplo n.º 1
0
        public void Can_add_remove_function()
        {
            var model = new EdmModel(DataSpace.SSpace);
            var function = new EdmFunction("F", "N", DataSpace.SSpace, new EdmFunctionPayload());

            model.AddItem(function);

            Assert.True(model.Functions.Contains(function));
            Assert.True(model.NamespaceItems.Contains(function));

            model.RemoveItem(function);

            Assert.False(model.Functions.Contains(function));
            Assert.False(model.NamespaceItems.Contains(function));
        }
Ejemplo n.º 2
0
        public void Can_add_remove_enum_type()
        {
            var model = new EdmModel(DataSpace.SSpace);
            var enumType = new EnumType { DataSpace = DataSpace.SSpace };

            model.AddItem(enumType);

            Assert.True(model.EnumTypes.Contains(enumType));
            Assert.True(model.NamespaceItems.Contains(enumType));

            model.RemoveItem(enumType);

            Assert.False(model.EnumTypes.Contains(enumType));
            Assert.False(model.NamespaceItems.Contains(enumType));
        }
Ejemplo n.º 3
0
        public void Can_add_remove_complex_type()
        {
            var model = new EdmModel(DataSpace.SSpace);
            var complexType = new ComplexType("C", "N", DataSpace.SSpace);

            model.AddItem(complexType);

            Assert.True(model.ComplexTypes.Contains(complexType));
            Assert.True(model.NamespaceItems.Contains(complexType));

            model.RemoveItem(complexType);

            Assert.False(model.ComplexTypes.Contains(complexType));
            Assert.False(model.NamespaceItems.Contains(complexType));
        }
Ejemplo n.º 4
0
        public void Can_add_remove_entity_type()
        {
            var model = new EdmModel(DataSpace.SSpace);
            var entityType = new EntityType("E", "N", DataSpace.SSpace);

            model.AddItem(entityType);

            Assert.True(model.EntityTypes.Contains(entityType));
            Assert.True(model.NamespaceItems.Contains(entityType));

            model.RemoveItem(entityType);

            Assert.False(model.EntityTypes.Contains(entityType));
            Assert.False(model.NamespaceItems.Contains(entityType));
        }
Ejemplo n.º 5
0
        public void Can_add_remove_association_type()
        {
            var model = new EdmModel(DataSpace.SSpace);
            var associationType = new AssociationType("A", "N", false, DataSpace.SSpace);

            model.AddItem(associationType);

            Assert.True(model.AssociationTypes.Contains(associationType));
            Assert.True(model.NamespaceItems.Contains(associationType));

            model.RemoveItem(associationType);

            Assert.False(model.AssociationTypes.Contains(associationType));
            Assert.False(model.NamespaceItems.Contains(associationType));
        }