“Requirements” – Order not important.
- Stock items
- Display stock with location codes and prices.
- Accepts money
- Only vend if the item is in stock and enough money has been inserted
- Make change (money)
using System.Collections.Generic; | |
using System.ComponentModel.DataAnnotations; | |
using System.Linq; | |
using CodeSlice.UnitTesting.Model; | |
using NSpec; | |
namespace CodeSlice.UnitTesting.NSpec | |
{ | |
class describe_Vote : nspec | |
{ |
using System; | |
using Castle.Core.Logging; | |
using System.Collections.Generic; | |
using NSpec; | |
using NSubstitute; | |
namespace Mephisto.Services | |
{ | |
class describe_FileTransformer : nspec | |
{ |
using System; | |
using System.Collections.Generic; | |
using NSpec; | |
namespace VendingMachineKata | |
{ | |
class describe_VendingMachine : nspec | |
{ | |
VendingMachine machine; | |
string firstSnickersVend; |
using NSpec; | |
using NSpec.Domain; | |
namespace SampleSpecs.Demo | |
{ | |
class describe_explicit_examples : nspec | |
{ | |
void hey_there() | |
{ | |
specify = () => "one way".should_be("one way"); |
“Requirements” – Order not important.
Map Kata | |
======== | |
* Given a simple grid, e.g. 10x10 | |
* Given a game piece is placed somewhere on the grid, e.g. 5,5 | |
* Given the piece canNOT be moved diagonally, e.g. one up, one left... | |
* Find all available squares to which the piece can move | |
** 1 move | |
** 2 moves | |
** etc... | |
** until you are thrilled with your solution or ready for something new |
* Customers can reserve seats and obtain a ticket | |
* Seats are only allocated to one customer | |
* Seats are assigned to a section/row/seat number | |
* Seats can be searched in blocks (consecutive adjacent seats) | |
* Sections vary in price | |
* Seats can be searched by price range | |
* Seats can be searched by price and number of adjacent seats |
using System.Linq; | |
using NSpec; | |
namespace SuperMarketKata | |
{ | |
class describe_Checkout : nspec | |
{ | |
void given_a_an_empty_sku_list() | |
{ | |
specify = () => Checkout("").Is(0); |
using System.Dynamic; | |
using System.Linq; | |
using System.Xml.Linq; | |
using NSpec; | |
class describe_Objectify : nspec | |
{ | |
dynamic kitten; | |
string markup; |
using System.Collections.Generic; | |
using System.Linq; | |
using NSpec; | |
namespace GameOfLifeKata | |
{ | |
class describe_Cell_Tick : nspec | |
{ | |
void before_each() | |
{ |