Skip to content

Instantly share code, notes, and snippets.

[Test]
public void WhenUserPlacesACorrectOrderWithMoreThenOneItemThenAnOrderNumberShouldBeReturned()
{
//Arrange
var shoppingCart = new ShoppingCart();
var itemOneId = Guid.NewGuid();
var itemTwoId = Guid.NewGuid();
int itemOneQuantity = 1;
int itemTwoQuantity = 4;
shoppingCart.Items.Add(new ShoppingCartItem { ItemId = itemOneId, Quantity = itemOneQuantity });
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StaticallyBoundLibrary
{
public class BusinessService
{
@JamesBender
JamesBender / cancellable-wait.js
Created January 20, 2017 19:01 — forked from ericelliott/cancellable-wait.js
Cancellable wait -- an ES6 promise example
const wait = (
time,
cancel = Promise.reject()
) => new Promise((resolve, reject) => {
const timer = setTimeout(resolve, time);
cancel.then(() => {
clearTimeout(timer);
reject(new Error('Cancelled'));
});
using System;
using GameNetworkInterfaces;
using Moq;
using NUnit.Framework;
using TicTacToe.Core;
namespace TicTacToe.Tests
{
[TestFixture]
class GameEngineTests
using GameNetworkInterfaces;
using System;
namespace TicTacToe.Core
{
public class GameEngine
{
private ICommonGameNetworkControl _gameNetworkControl;
public GameEngine(ICommonGameNetworkControl gameNetworkControl)
@JamesBender
JamesBender / NebraskaCodeGameEngineTests
Created May 18, 2016 16:40
Game Engine Tests for TDD
using System;
using GameNetworkInterfaces;
using Moq;
using NUnit.Framework;
using TicTacToe.Core;
namespace TicTacToe.UnitTests
{
[TestFixture]
class GameEngineTests
using System;
using GameNetworkInterfaces;
namespace TicTacToe.Core
{
public class GameEngine
{
private ICommonGameNetworkControl _network;
public GameEngine(ICommonGameNetworkControl network)
using System;
using TicTacToe.Core.ExternalSystem;
namespace TicTacToe.Core
{
public class GameEngine
{
private ICommonGameNetworkControl _networkInterface;
public GameEngine(ICommonGameNetworkControl networkInterface)
using System;
using Moq;
using NUnit.Framework;
using TicTacToe.Core;
using TicTacToe.Core.ExternalSystem;
namespace TicTacToe.Tests
{
[TestFixture]
public class TicTacToeGameEngineTests
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