public async Task RecordMove_GivenTicketAndMove_ExpectMoveBeRecorded()
        {
            //Arrange
            var agniKai = new AgniKai {
                Ticket = "12345"
            };
            var         mockVault     = Substitute.For <IVault>();
            var         mockKeyGen    = Substitute.For <IKeyGenerator>();
            var         database      = new DatabaseRepository(mockVault, mockKeyGen);
            var         move          = (2, 3);
            var         expectedState = new State();
            const Field indicator     = Field.X;

            expectedState.Fields[2][3] = indicator;

            //Act
            await database.AddAgniKaiAsync(agniKai);

            await database.RecordMoveAsync(agniKai.Ticket, move, indicator);

            var state = await database.GetStateAsync(agniKai.Ticket);

            //Assert
            state.ShouldBeEquivalentTo(expectedState);
        }
        public async Task SubmitTicketAsync_GivenTokenAndTicket_ExpectTicketBeAdded()
        {
            //Arrange
            const string token    = "token";
            const string ticket   = "ticket";
            const string name     = "Player-1";
            var          expected = new Player
            {
                Name          = name,
                GameToken     = token,
                AgniKaiTicket = ticket,
                Status        = PlayerStatus.Online
            };
            var mockVault  = Substitute.For <IVault>();
            var mockKeyGen = Substitute.For <IKeyGenerator>();

            mockKeyGen.GenerateGameTokenAsync(name).Returns("token");
            var database = new DatabaseRepository(mockVault, mockKeyGen);

            //Act
            await database.AddAgniKaiAsync(new AgniKai { Ticket = ticket });

            await database.AddPlayerAsync(name);

            await database.SubmitTicketAsync(token, ticket);

            var result = await database.GetPlayerByNameAsync(name);

            expected.Indicator = result.Indicator;

            //Assert
            result.ShouldBeEquivalentTo(expected);
        }
        public async Task AddAgniKaiAsync_GivenAgniKai_ExpectAgniKaiBeAdded()
        {
            //Arrange
            var agniKai = new AgniKai {
                Ticket = "12345"
            };
            var mockVault  = Substitute.For <IVault>();
            var mockKeyGen = Substitute.For <IKeyGenerator>();
            var database   = new DatabaseRepository(mockVault, mockKeyGen);

            //Act
            await database.AddAgniKaiAsync(agniKai);

            var result = await database.GetAgniKaiByTicketAsync("12345");

            var state = await database.GetStateAsync(agniKai.Ticket);

            //Assert
            result.ShouldBeEquivalentTo(agniKai);
            state.ShouldBeEquivalentTo(new State());
        }