Пример #1
0
        public void ShouldWriteListForListMapping()
        {
            var mapping = CollectionMapping.List();

            writer.VerifyXml(mapping)
            .RootElement.HasName("list");
        }
        public void ShouldNotWriteCollectionTypeWhenEmpty()
        {
            var mapping = CollectionMapping.List();

            mapping.Set(x => x.CollectionType, Layer.Defaults, TypeReference.Empty);
            writer.VerifyXml(mapping)
            .DoesntHaveAttribute("collection-type");
        }
Пример #3
0
        public void ShouldWriteList()
        {
            var mapping = new SubclassMapping(SubclassType.JoinedSubclass);

            mapping.AddCollection(CollectionMapping.List());

            writer.VerifyXml(mapping)
            .Element("list").Exists();
        }
Пример #4
0
        public void ShouldWriteLists()
        {
            var mapping = new ComponentMapping(ComponentType.DynamicComponent);

            mapping.AddCollection(CollectionMapping.List());

            writer.VerifyXml(mapping)
            .Element("list").Exists();
        }
        public void ShouldWriteLists()
        {
            var mapping = CreateInstance();

            mapping.AddCollection(CollectionMapping.List());

            writer.VerifyXml(mapping)
            .Element("list").Exists();
        }
        public void ShouldWriteElement()
        {
            var mapping = CollectionMapping.List();

            mapping.Set(x => x.Element, Layer.Defaults, new ElementMapping());

            writer.VerifyXml(mapping)
            .Element("element").Exists();
        }
        public void ShouldWriteCacheElement()
        {
            var mapping = CollectionMapping.List();

            mapping.Set(x => x.Cache, Layer.Defaults, new CacheMapping());

            writer.VerifyXml(mapping)
            .Element("cache").Exists();
        }
        public void ShouldWriteIndexElement()
        {
            var mapping = CollectionMapping.List();

            mapping.Set(x => x.Index, Layer.Defaults, new IndexMapping());

            writer.VerifyXml(mapping)
            .Element("index").Exists();
        }
        public void ShouldWriteRelationshipElement()
        {
            var mapping = CollectionMapping.List();

            mapping.Set(x => x.Relationship, Layer.Defaults, new OneToManyMapping());

            writer.VerifyXml(mapping)
            .Element("one-to-many").Exists();
        }
Пример #10
0
        public void ShouldWriteKey()
        {
            var mapping = CollectionMapping.List();

            mapping.Set(x => x.Key, Layer.Defaults, new KeyMapping());

            writer.VerifyXml(mapping)
            .Element("key").Exists();
        }
Пример #11
0
        /// <summary>
        /// Use a list collection with an index
        /// </summary>
        /// <param name="customIndexMapping">Index mapping</param>
        public T AsList(Action <ListIndexPart> customIndexMapping)
        {
            collectionBuilder = attrs => CollectionMapping.List(attrs);
            CreateListIndexMapping(customIndexMapping);

            if (indexMapping.Columns.IsEmpty())
            {
                var columnMapping = new ColumnMapping();
                columnMapping.Set(x => x.Name, Layer.Defaults, "Index");
                indexMapping.AddColumn(Layer.Defaults, columnMapping);
            }

            return((T)this);
        }