Skip to content

Instantly share code, notes, and snippets.

@JamesBender
JamesBender / cancellable-wait.js
Created Jan 20, 2017 — forked from ericelliott/cancellable-wait.js
Cancellable wait -- an ES6 promise example
View cancellable-wait.js
const wait = (
time,
cancel = Promise.reject()
) => new Promise((resolve, reject) => {
const timer = setTimeout(resolve, time);
cancel.then(() => {
clearTimeout(timer);
reject(new Error('Cancelled'));
});
View kcdc2016-tests
using System;
using GameNetworkInterfaces;
using Moq;
using NUnit.Framework;
using TicTacToe.Core;
namespace TicTacToe.Tests
{
[TestFixture]
class GameEngineTests
View KCDC2016-gameengine
using GameNetworkInterfaces;
using System;
namespace TicTacToe.Core
{
public class GameEngine
{
private ICommonGameNetworkControl _gameNetworkControl;
public GameEngine(ICommonGameNetworkControl gameNetworkControl)
View NebraskaCodeGameEngineTests
using System;
using GameNetworkInterfaces;
using Moq;
using NUnit.Framework;
using TicTacToe.Core;
namespace TicTacToe.UnitTests
{
[TestFixture]
class GameEngineTests
View NebraskCodeGameEngine.cs
using System;
using GameNetworkInterfaces;
namespace TicTacToe.Core
{
public class GameEngine
{
private ICommonGameNetworkControl _network;
public GameEngine(ICommonGameNetworkControl network)
View Philly Test - Engine
using System;
using TicTacToe.Core.ExternalSystem;
namespace TicTacToe.Core
{
public class GameEngine
{
private ICommonGameNetworkControl _networkInterface;
public GameEngine(ICommonGameNetworkControl networkInterface)
View Philly - Tests
using System;
using Moq;
using NUnit.Framework;
using TicTacToe.Core;
using TicTacToe.Core.ExternalSystem;
namespace TicTacToe.Tests
{
[TestFixture]
public class TicTacToeGameEngineTests
View GameEngine.cs
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
View GamingEngineTests.cs
using System;
using Moq;
using NUnit.Framework;
using TicTacToe.Core;
using TicTacToe.Core.GameNetworkInterfaces;
namespace TicTacToe.Tests
{
[TestFixture]
public class GameEngineTests
@JamesBender
JamesBender / ICommonGameNetworkControl.cs
Created Nov 11, 2015
ICommonGameNetworkControl and supporting classes for TDD-PreCon
View ICommonGameNetworkControl.cs
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);