public async Task InitTest()
        {
            ConnectionString = new ConnectionStringsForTest().GetConnectionString(DatabaseName);
            Database         = new DatabaseConnection(ConnectionString);

            var fakedFactory = A.Fake <IDatabaseConnectionFactory>();

            A.CallTo(() => fakedFactory.GetDatabaseConnection(Factories.Database.Main)).Returns(Database);

            var userRepo                 = new UserRepoService(fakedFactory, new UserQueries());
            var matchRepoService         = new MatchRepoService(fakedFactory, new MatchQueries());
            var coinFlipMatchRepoService = new CoinFlipMatchRepoService(fakedFactory);

            var gameModeRepoService = new GameModeRepoService(fakedFactory);

            var gameMode  = new DatabaseModel.GameMode(GameModeHelper.GetStringFromType(GameModeType.JackpotCsgo), 1);
            var gameMode1 = new DatabaseModel.GameMode(GameModeHelper.GetStringFromType(GameModeType.CoinFlip), 1);

            GameMode = await gameModeRepoService.Insert(gameMode);

            GameMode1 = await gameModeRepoService.Insert(gameMode1);

            User1 = await userRepo.InsertAsync(new DatabaseModel.User(
                                                   "987654321",
                                                   "Kalle",
                                                   " ba/bab154f01140ec39b2986d97838f0127534ec82d_full.jpg ",
                                                   "?partner=117688384&token=mn347bmb ",
                                                   DateTime.Now,
                                                   DateTime.Now,
                                                   false
                                                   ));

            User2 = await userRepo.InsertAsync(new DatabaseModel.User(
                                                   "987154321",
                                                   "Kalle",
                                                   " ba/bab154f01140ec39b2986d97838f0127534ec82d_full.jpg ",
                                                   "?partner=117688384&token=mn347bmb ",
                                                   DateTime.Now,
                                                   DateTime.Now,
                                                   false
                                                   ));

            User3 = await userRepo.InsertAsync(new DatabaseModel.User(
                                                   "983654321",
                                                   "Kalle",
                                                   " ba/bab154f01140ec39b2986d97838f0127534ec82d_full.jpg ",
                                                   "?partner=117688384&token=mn347bmb ",
                                                   DateTime.Now,
                                                   DateTime.Now,
                                                   false
                                                   ));

            User4 = await userRepo.InsertAsync(new DatabaseModel.User(
                                                   "983656584",
                                                   "Kalle",
                                                   " ba/bab154f01140ec39b2986d97838f0127534ec82d_full.jpg ",
                                                   "?partner=117688384&token=mn347bmb ",
                                                   DateTime.Now,
                                                   DateTime.Now,
                                                   false
                                                   ));

            Match1 = await matchRepoService.InsertAsync(new DatabaseModel.Match(
                                                            11,
                                                            "salt",
                                                            "hash",
                                                            47.5484.ToString(CultureInfo.InvariantCulture),
                                                            1,
                                                            null,
                                                            null,
                                                            1,
                                                            GameMode.Id,
                                                            DateTime.Now
                                                            ));

            Match2 = await matchRepoService.InsertAsync(new DatabaseModel.Match(
                                                            12,
                                                            "salt",
                                                            "hash",
                                                            47.5484.ToString(CultureInfo.InvariantCulture),
                                                            1,
                                                            null,
                                                            null,
                                                            1,
                                                            GameMode.Id,
                                                            DateTime.Now
                                                            ));

            Match3 = await matchRepoService.InsertAsync(new DatabaseModel.Match(
                                                            13,
                                                            "salt",
                                                            "hash",
                                                            47.5484.ToString(CultureInfo.InvariantCulture),
                                                            1,
                                                            null,
                                                            null,
                                                            1,
                                                            GameMode.Id,
                                                            DateTime.Now
                                                            ));

            using (var transaction = new TransactionWrapperWrapper(Database))
            {
                CoinFlip1 = await coinFlipMatchRepoService.InsertAsync(new DatabaseModel.CoinFlip
                {
                    Created       = DateTime.Today,
                    CreatorIsHead = true,
                    CreatorUserId = User1.Id,
                    GameModeId    = gameMode1.Id,
                    Hash          = "",
                    Percentage    = "",
                    Salt          = "",
                    RoundId       = "xF!",
                    SettingId     = 0,
                    Status        = 1,
                    TimerStarted  = null,
                    WinnerId      = null
                }, transaction);

                CoinFlip2 = await coinFlipMatchRepoService.InsertAsync(new DatabaseModel.CoinFlip
                {
                    Created       = DateTime.Today,
                    CreatorIsHead = true,
                    CreatorUserId = User1.Id,
                    GameModeId    = gameMode1.Id,
                    Hash          = "",
                    Percentage    = "",
                    Salt          = "",
                    RoundId       = "xD1",
                    SettingId     = 0,
                    Status        = 1,
                    TimerStarted  = null,
                    WinnerId      = null
                }, transaction);

                CoinFlip3 = await coinFlipMatchRepoService.InsertAsync(new DatabaseModel.CoinFlip
                {
                    Created       = DateTime.Today,
                    CreatorIsHead = true,
                    CreatorUserId = User1.Id,
                    GameModeId    = gameMode1.Id,
                    Hash          = "",
                    Percentage    = "",
                    Salt          = "",
                    RoundId       = "xD",
                    SettingId     = 0,
                    Status        = 1,
                    TimerStarted  = null,
                    WinnerId      = null
                }, transaction);

                transaction.Commit();
            }
        }
 public CoinFlipIntegrationTest(CoinFlipIntegrationTestServiceIntegrationTestSetup setup)
 {
     _setup = setup;
     _coinFlipMatchRepoService = new CoinFlipMatchRepoService(_setup.FakedFactory);
 }