This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const wait = ( | |
time, | |
cancel = Promise.reject() | |
) => new Promise((resolve, reject) => { | |
const timer = setTimeout(resolve, time); | |
cancel.then(() => { | |
clearTimeout(timer); | |
reject(new Error('Cancelled')); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using GameNetworkInterfaces; | |
using Moq; | |
using NUnit.Framework; | |
using TicTacToe.Core; | |
namespace TicTacToe.Tests | |
{ | |
[TestFixture] | |
class GameEngineTests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using GameNetworkInterfaces; | |
using System; | |
namespace TicTacToe.Core | |
{ | |
public class GameEngine | |
{ | |
private ICommonGameNetworkControl _gameNetworkControl; | |
public GameEngine(ICommonGameNetworkControl gameNetworkControl) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using GameNetworkInterfaces; | |
using Moq; | |
using NUnit.Framework; | |
using TicTacToe.Core; | |
namespace TicTacToe.UnitTests | |
{ | |
[TestFixture] | |
class GameEngineTests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using GameNetworkInterfaces; | |
namespace TicTacToe.Core | |
{ | |
public class GameEngine | |
{ | |
private ICommonGameNetworkControl _network; | |
public GameEngine(ICommonGameNetworkControl network) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using TicTacToe.Core.ExternalSystem; | |
namespace TicTacToe.Core | |
{ | |
public class GameEngine | |
{ | |
private ICommonGameNetworkControl _networkInterface; | |
public GameEngine(ICommonGameNetworkControl networkInterface) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using Moq; | |
using NUnit.Framework; | |
using TicTacToe.Core; | |
using TicTacToe.Core.ExternalSystem; | |
namespace TicTacToe.Tests | |
{ | |
[TestFixture] | |
public class TicTacToeGameEngineTests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using TicTacToe.Core.GameNetworkInterfaces; | |
namespace TicTacToe.Core | |
{ | |
public class GameEngine |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using Moq; | |
using NUnit.Framework; | |
using TicTacToe.Core; | |
using TicTacToe.Core.GameNetworkInterfaces; | |
namespace TicTacToe.Tests | |
{ | |
[TestFixture] | |
public class GameEngineTests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
namespace GameNetworkInterfaces | |
{ | |
public interface ICommonGameNetworkControl | |
{ | |
Guid Login(string username, string password); | |
bool Logout(Guid sessionToken); | |
int PostScoreToLeaderboard(Guid sessionToken, Guid gameToken, int score); |
NewerOlder