-
Notifications
You must be signed in to change notification settings - Fork 3
msuarz edited this page Jan 24, 2013
·
8 revisions
Let's suppose we have a fancy Calculator
So fancy that it is implemented in C#
We could write the regular docs
It can do stuff like
2 + 2 = 4
4 - 2 = 2
require 'csharp'
using 'Math.Calculator'
class @Calculator
constructor: ->
@calculator = new Calculator
'@x + @y = @result': (x, y, result) ->
@calculator.Add(x, y).should.eql result
'@x - @y = @result': (x, y, result) ->
@calculator.Subtract(x, y).should.eql result
namespace Math
{
public class Calculator
{
public int Add(int x, int y)
{
return x + y;
}
public int Subtract(int x, int y)
{
return x - y;
}
}
}