Exemple #1
0
        public void CanEnsureIndexOnMultipleKeysOfDifferentTypes()
        {
            // Arrange.
            OrmongoConfiguration.AutoCreateIndexes = true;

            // Act.
            BlogPost.EnsureIndex(bp => bp.Text, bp => bp.DatePublished);

            // Assert.
            Assert.That(BlogPost.GetCollection().IndexExistsByName("Text_1_DatePublished_1"), Is.True);
        }
Exemple #2
0
        public void CanEnsureIndexOnSingleKey()
        {
            // Arrange.
            OrmongoConfiguration.AutoCreateIndexes = true;

            // Act.
            BlogPost.EnsureIndex(bp => bp.Text);

            // Assert.
            Assert.That(BlogPost.GetCollection().IndexExistsByName("Text_1"), Is.True);
        }