Skip to content

Instantly share code, notes, and snippets.

@JamesTryand
Created March 31, 2012 20:22
Show Gist options
  • Select an option

  • Save JamesTryand/2268131 to your computer and use it in GitHub Desktop.

Select an option

Save JamesTryand/2268131 to your computer and use it in GitHub Desktop.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Simple.Testing;
using Simple.Testing.ClientFramework;
namespace ClassLibrary1
{
public class Class1
{
public Specification When_I_enter_two_numbers_they_are_added()
{
return new QuerySpecification<ProfessorMonkeyBoy, MathResult>()
{
On = () => new ProfessorMonkeyBoy(),
When = theProf => theProf.AddsSomeNumbers(2, 3),
Expect = {
result => result != null,
result => result is MathResult,
result => result.Value.Equals(5),
},
};
}
}
public class ProfessorMonkeyBoy
{
public MathResult AddsSomeNumbers(int first, int second)
{
return new MathResult() { Value = first + second };
}
}
public class MathResult
{
public int Value { get; set; }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment