Exemple #1
0
        private void TestIndexMultipleInsert(string s, int i, int r, bool shouldFail = false)
        {
            using (var container = new RhetosTestContainer())
            {
                container.Resolve <ISqlExecuter>().ExecuteSql(new[]
                {
                    "DELETE FROM TestUnique.Multi;",
                    "DELETE FROM TestUnique.R;"
                });

                var repository = container.Resolve <Common.DomRepository>();
                var helper     = new EntityHelperMultiple(container, repository);

                var r1 = new TestUnique.R {
                    S = "r1"
                };
                var r2 = new TestUnique.R {
                    S = "r2"
                };
                repository.TestUnique.R.Insert(new[] { r1, r2 });

                helper.Insert("a", 1, r1);
                helper.Insert(s, i, r == 1 ? r1 : r2, shouldFail);
            }
        }
Exemple #2
0
        private void TestIndexMultipleInsert(string s, int i, int r, bool shouldFail = false)
        {
            using (var container = new RhetosTestContainer())
            {
                container.Resolve<ISqlExecuter>().ExecuteSql(new[]
                    {
                        "DELETE FROM TestUnique.Multi;",
                        "DELETE FROM TestUnique.R;"
                    });

                var repository = container.Resolve<Common.DomRepository>();
                var helper = new EntityHelperMultiple(container, repository);

                var r1 = new TestUnique.R { S = "r1" };
                var r2 = new TestUnique.R { S = "r2" };
                repository.TestUnique.R.Insert(new[] { r1, r2 });

                helper.Insert("a", 1, r1);
                helper.Insert(s, i, r == 1 ? r1 : r2, shouldFail);
            }
        }
Exemple #3
0
        private void TestIndexMultipleInsert(string s, int i, int r, bool shouldFail = false)
        {
            using (var executionContext = new CommonTestExecutionContext())
            {
                executionContext.SqlExecuter.ExecuteSql(new[]
                    {
                        "DELETE FROM TestUnique.Multi;",
                        "DELETE FROM TestUnique.R;"
                    });

                var repository = new Common.DomRepository(executionContext);
                var helper = new EntityHelperMultiple(executionContext, repository);

                var r1 = new TestUnique.R { S = "r1" };
                var r2 = new TestUnique.R { S = "r2" };
                repository.TestUnique.R.Insert(new[] { r1, r2 });

                helper.Insert("a", 1, r1);
                helper.Insert(s, i, r == 1 ? r1 : r2, shouldFail);
            }
        }