Last active
March 20, 2017 20:32
-
-
Save amirrajan/573054053513fd7fbfe5430127212c9b to your computer and use it in GitHub Desktop.
NSpec Hello World
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using NSpec; | |
using FluentAssertions; | |
class my_first_spec : nspec | |
{ | |
string name; | |
void before_each() | |
{ | |
name = "NSpec"; | |
} | |
void it_asserts_at_the_method_level() | |
{ | |
name.ShouldBeEquivalentTo("NSpec"); | |
} | |
void describe_nesting() | |
{ | |
before = () => name += " Add Some Other Stuff"; | |
it["asserts in a method"] = () => | |
{ | |
name.ShouldBeEquivalentTo("NSpec Add Some Other Stuff"); | |
}; | |
context["more nesting"] = () => | |
{ | |
before = () => name += ", And Even More"; | |
it["also asserts in a lambda"] = () => | |
{ | |
name.ShouldBeEquivalentTo("NSpec Add Some Other Stuff, And Even More"); | |
}; | |
}; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment