public void AsTernaryAssocationShouldCreateIndexManyToMany()
 {
     OneToMany(x => x.EntityMapOfChildren)
     .Mapping(m => m.AsMap("irrelevant-value").AsTernaryAssociation())
     .ModelShouldMatch(x =>
     {
         IIndexMapping index = ((MapMapping)x).Index;
         index.ShouldBeOfType(typeof(IndexManyToManyMapping));
     });
 }
 public void EntityMapIsAMapWithAManyToManyIndex()
 {
     OneToMany(x => x.EntityMapOfChildren)
     .Mapping(m => m.AsEntityMap())
     .ModelShouldMatch(x =>
     {
         x.ShouldBeOfType(typeof(MapMapping));
         IIndexMapping index = ((MapMapping)x).Index;
         index.ShouldBeOfType(typeof(IndexManyToManyMapping));
     });
 }
        public void AsEntityMapShouldSetProvidedColumnName()
        {
            const string indexName = "index-name";

            OneToMany(x => x.EntityMapOfChildren)
            .Mapping(m => m.AsEntityMap(indexName))
            .ModelShouldMatch(x =>
            {
                x.ShouldBeOfType(typeof(MapMapping));
                IIndexMapping index = ((MapMapping)x).Index;
                index.ShouldBeOfType(typeof(IndexManyToManyMapping));
                index.Columns.Single().Name.ShouldEqual(indexName);
            });
        }
        public void AsEntityMapShouldSetProvidedColumnName()
        {
            const string indexName = "index-name";
            const string valueName = "value-name";

            ManyToMany(x => x.GenericTernaryMapOfChildren)
            .Mapping(m => m.AsEntityMap(indexName, valueName))
            .ModelShouldMatch(x =>
            {
                x.ShouldBeOfType(typeof(MapMapping));
                IIndexMapping index = ((MapMapping)x).Index;
                index.ShouldBeOfType(typeof(IndexManyToManyMapping));
                index.Columns.Single().Name.ShouldEqual(indexName);

                var relationship = (ManyToManyMapping)((MapMapping)x).Relationship;
                relationship.Columns.Count().ShouldEqual(1);
                relationship.Columns.First().Name.ShouldEqual(valueName);
            });
        }