public void CreateCompoundIndexStronglyTyped()
        {
            var index = testTable.IndexDefine("Compound", a => a.Name, a => a.SomeNumber);

            connection.Run(index.IndexCreate());

            var resp = connection.Run(testTable.Insert(new TestObject[] {
                new TestObject()
                {
                    Name = "1", SomeNumber = 1
                },
                new TestObject()
                {
                    Name = "2", SomeNumber = 2
                },
                new TestObject()
                {
                    Name = "3", SomeNumber = 3
                },
            }));

            Assert.That(resp, Is.Not.Null);

            connection.Run(index.IndexWait()).ToArray(); // ToArray ensures that the IEnumerable is actually evaluated completely and the wait is completed

            var results = connection.Run(index.GetAll(index.Key("1", 1)));

            results.Should().HaveCount(1);
        }
 public override void TestFixtureSetUp()
 {
     base.TestFixtureSetUp();
     connection.RunAsync(Query.DbCreate("test")).Wait();
     connection.RunAsync(Query.Db("test").TableCreate("table")).Wait();
     testTable = Query.Db("test").Table <TestObject>("table");
     nameIndex = testTable.IndexDefine("index1", o => o.Name);
     connection.Run(nameIndex.IndexCreate());
     connection.Run(nameIndex.IndexWait());
 }
 public override void TestFixtureSetUp()
 {
     base.TestFixtureSetUp();
     connection.RunAsync(Query.DbCreate("test")).Wait();
     connection.RunAsync(Query.Db("test").TableCreate("table")).Wait();
     testTable = Query.Db("test").Table<TestObject>("table");
     nameIndex = testTable.IndexDefine("index1", o => o.Name);
     connection.Run(nameIndex.IndexCreate());
     connection.Run(nameIndex.IndexWait());
 }
 public override void TestFixtureSetUp()
 {
     base.TestFixtureSetUp();
     connection.RunAsync(Query.DbCreate("test")).Wait();
     connection.RunAsync(Query.Db("test").TableCreate("table")).Wait();
     testTable = Query.Db("test").Table<TestObject>("table");
     nameIndex = testTable.IndexDefine("index1", o => o.Name);
     connection.Run(nameIndex.IndexCreate());
     connection.Run(nameIndex.IndexWait()).ToArray(); // ToArray ensures that the IEnumerable is actually evaluated completely and the wait is completed
 }
 public override void TestFixtureSetUp()
 {
     base.TestFixtureSetUp();
     connection.RunAsync(Query.DbCreate("test")).Wait();
     connection.RunAsync(Query.Db("test").TableCreate("table")).Wait();
     testTable = Query.Db("test").Table <TestObject>("table");
     nameIndex = testTable.IndexDefine("index1", o => o.Name);
     connection.Run(nameIndex.IndexCreate());
     connection.Run(nameIndex.IndexWait()).ToArray(); // ToArray ensures that the IEnumerable is actually evaluated completely and the wait is completed
 }
Exemple #6
0
        public override void TestFixtureSetUp()
        {
            base.TestFixtureSetUp();
            connection.RunAsync(Query.DbCreate("test")).Wait();
            connection.RunAsync(Query.Db("test").TableCreate("table1")).Wait();
            connection.RunAsync(Query.Db("test").TableCreate("table2")).Wait();

            testTable        = Query.Db("test").Table <TestObject>("table1");
            anotherTestTable = Query.Db("test").Table <AnotherTestObject>("table2");

            firstNameIndex = anotherTestTable.IndexDefine("index1", o => o.FirstName);
            connection.Run(firstNameIndex.IndexCreate());
            connection.Run(firstNameIndex.IndexWait());

            tagsIndex = testTable.IndexDefineMulti("indexTags", o => o.Tags);
            connection.Run(tagsIndex.IndexCreate());
            connection.Run(tagsIndex.IndexWait());
        }
        public override void TestFixtureSetUp()
        {
            base.TestFixtureSetUp();
            connection.RunAsync(Query.DbCreate("test")).Wait();
            connection.RunAsync(Query.Db("test").TableCreate("table1")).Wait();
            connection.RunAsync(Query.Db("test").TableCreate("table2")).Wait();

            testTable = Query.Db("test").Table<TestObject>("table1");
            anotherTestTable = Query.Db("test").Table<AnotherTestObject>("table2");

            firstNameIndex = anotherTestTable.IndexDefine("index1", o => o.FirstName);
            connection.Run(firstNameIndex.IndexCreate());
            connection.Run(firstNameIndex.IndexWait());

            tagsIndex = testTable.IndexDefineMulti("indexTags", o => o.Tags);
            connection.Run(tagsIndex.IndexCreate());
            connection.Run(tagsIndex.IndexWait());
        }
        public override void TestFixtureSetUp()
        {
            base.TestFixtureSetUp();
            connection.RunAsync(Query.DbCreate("test")).Wait();
            connection.RunAsync(Query.Db("test").TableCreate("table1")).Wait();
            connection.RunAsync(Query.Db("test").TableCreate("table2")).Wait();

            testTable = Query.Db("test").Table<TestObject>("table1");
            anotherTestTable = Query.Db("test").Table<AnotherTestObject>("table2");

            firstNameIndex = anotherTestTable.IndexDefine("index1", o => o.FirstName);
            connection.Run(firstNameIndex.IndexCreate());
            connection.Run(firstNameIndex.IndexWait()).ToArray(); // ToArray ensures that the IEnumerable is actually evaluated completely and the wait is completed

            tagsIndex = testTable.IndexDefineMulti("indexTags", o => o.Tags);
            connection.Run(tagsIndex.IndexCreate());
            connection.Run(tagsIndex.IndexWait()).ToArray(); // ToArray ensures that the IEnumerable is actually evaluated completely and the wait is completed
        }
        public override void TestFixtureSetUp()
        {
            base.TestFixtureSetUp();
            connection.RunAsync(Query.DbCreate("test")).Wait();
            connection.RunAsync(Query.Db("test").TableCreate("table1")).Wait();
            connection.RunAsync(Query.Db("test").TableCreate("table2")).Wait();

            testTable        = Query.Db("test").Table <TestObject>("table1");
            anotherTestTable = Query.Db("test").Table <AnotherTestObject>("table2");

            firstNameIndex = anotherTestTable.IndexDefine("index1", o => o.FirstName);
            connection.Run(firstNameIndex.IndexCreate());
            connection.Run(firstNameIndex.IndexWait()).ToArray(); // ToArray ensures that the IEnumerable is actually evaluated completely and the wait is completed

            tagsIndex = testTable.IndexDefineMulti("indexTags", o => o.Tags);
            connection.Run(tagsIndex.IndexCreate());
            connection.Run(tagsIndex.IndexWait()).ToArray(); // ToArray ensures that the IEnumerable is actually evaluated completely and the wait is completed
        }
        public override void TestFixtureSetUp()
        {
            base.TestFixtureSetUp();
            connection.Run(Query.DbCreate("test"));
            connection.Run(Query.Db("test").TableCreate("table"));

            testTable = Query.Db("test").Table<TestObject>("table");
            connection.Run(testTable.Insert(new TestObject[]
            {
                new TestObject() { Name = "1", SomeNumber = 1 },
                new TestObject() { Name = "1", SomeNumber = 1 },
                new TestObject() { Name = "2", SomeNumber = 2, Tags = new string[] { "A", "B" } },
                new TestObject() { Name = "2", SomeNumber = 200 },
                new TestObject() { Name = "2", SomeNumber = 2, Tags = new string[] { "A", "C" } },
                new TestObject() { Name = "3", SomeNumber = 3 },
                new TestObject() { Name = "3", SomeNumber = 3 },
                new TestObject() { Name = "4", SomeNumber = 4 },
                new TestObject() { Name = "5", SomeNumber = 5 },
                new TestObject() { Name = "6", SomeNumber = 6 },
                new TestObject() { Name = "6", SomeNumber = 6 },
                new TestObject() { Name = "7", SomeNumber = 7 },
            }));

            nameIndex = testTable.IndexDefine("name", to => to.Name);
            connection.Run(nameIndex.IndexCreate());
            connection.Run(nameIndex.IndexWait()).ToArray(); // ToArray ensures that the IEnumerable is actually evaluated completely and the wait is completed
        }
        public override void TestFixtureSetUp()
        {
            base.TestFixtureSetUp();
            connection.Run(Query.DbCreate("test"));
            connection.Run(Query.Db("test").TableCreate("table"));

            testTable = Query.Db("test").Table <TestObject>("table");
            connection.Run(testTable.Insert(new TestObject[]
            {
                new TestObject()
                {
                    Name = "1", SomeNumber = 1
                },
                new TestObject()
                {
                    Name = "1", SomeNumber = 1
                },
                new TestObject()
                {
                    Name = "2", SomeNumber = 2, Tags = new string[] { "A", "B" }
                },
                new TestObject()
                {
                    Name = "2", SomeNumber = 200
                },
                new TestObject()
                {
                    Name = "2", SomeNumber = 2, Tags = new string[] { "A", "C" }
                },
                new TestObject()
                {
                    Name = "3", SomeNumber = 3
                },
                new TestObject()
                {
                    Name = "3", SomeNumber = 3
                },
                new TestObject()
                {
                    Name = "4", SomeNumber = 4
                },
                new TestObject()
                {
                    Name = "5", SomeNumber = 5
                },
                new TestObject()
                {
                    Name = "6", SomeNumber = 6
                },
                new TestObject()
                {
                    Name = "6", SomeNumber = 6
                },
                new TestObject()
                {
                    Name = "7", SomeNumber = 7
                },
            }));

            nameIndex = testTable.IndexDefine("name", to => to.Name);
            connection.Run(nameIndex.IndexCreate());
            connection.Run(nameIndex.IndexWait());
        }
Exemple #12
0
        public override void TestFixtureSetUp()
        {
            base.TestFixtureSetUp();
            connection.Run(Query.DbCreate("test"));
            connection.Run(Query.Db("test").TableCreate("table"));

            testTable = Query.Db("test").Table <TestObject>("table");
            connection.Run(testTable.Insert(new TestObject[]
            {
                new TestObject()
                {
                    Name = "1", SomeNumber = 1
                },
                new TestObject()
                {
                    Name = "1", SomeNumber = 1
                },
                new TestObject()
                {
                    Name = "2", SomeNumber = 2, Tags = new string[] { "A", "B" }
                },
                new TestObject()
                {
                    Name = "2", SomeNumber = 200
                },
                new TestObject()
                {
                    Name = "2", SomeNumber = 2, Tags = new string[] { "A", "C" }
                },
                new TestObject()
                {
                    Name = "3", SomeNumber = 3
                },
                new TestObject()
                {
                    Name = "3", SomeNumber = 3
                },
                new TestObject()
                {
                    Name = "4", SomeNumber = 4
                },
                new TestObject()
                {
                    Name = "5", SomeNumber = 5
                },
                new TestObject()
                {
                    Name = "6", SomeNumber = 6
                },
                new TestObject()
                {
                    Name = "6", SomeNumber = 6
                },
                new TestObject()
                {
                    Name = "7", SomeNumber = 7
                },
            }));

            nameIndex = testTable.IndexDefine("name", to => to.Name);
            connection.Run(nameIndex.IndexCreate());
            connection.Run(nameIndex.IndexWait()).ToArray(); // ToArray ensures that the IEnumerable is actually evaluated completely and the wait is completed
        }
Exemple #13
0
        public override void TestFixtureSetUp()
        {
            base.TestFixtureSetUp();
            connection.Run(Query.DbCreate("test"));
            connection.Run(Query.Db("test").TableCreate("table"));

            testTable = Query.Db("test").Table<TestObject>("table");
            connection.Run(testTable.Insert(new TestObject[]
            {
                new TestObject() { Name = "1", SomeNumber = 1 },
                new TestObject() { Name = "1", SomeNumber = 1 },
                new TestObject() { Name = "2", SomeNumber = 2, Tags = new string[] { "A", "B" } },
                new TestObject() { Name = "2", SomeNumber = 200 },
                new TestObject() { Name = "2", SomeNumber = 2, Tags = new string[] { "A", "C" } },
                new TestObject() { Name = "3", SomeNumber = 3 },
                new TestObject() { Name = "3", SomeNumber = 3 },
                new TestObject() { Name = "4", SomeNumber = 4 },
                new TestObject() { Name = "5", SomeNumber = 5 },
                new TestObject() { Name = "6", SomeNumber = 6 },
                new TestObject() { Name = "6", SomeNumber = 6 },
                new TestObject() { Name = "7", SomeNumber = 7 },
            }));

            nameIndex = testTable.IndexDefine("name", to => to.Name);
            connection.Run(nameIndex.IndexCreate());
            connection.Run(nameIndex.IndexWait());
        }