Created
May 20, 2011 21:11
-
-
Save Ang3lFir3/983808 to your computer and use it in GitHub Desktop.
NSpec Example using specify syntax
This file contains 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
class transforming_files : nspec | |
{ | |
void with_a_file_transformer () | |
{ | |
var logger = Substitute.For<ILogger>(); | |
var reader = Substitute.For<IFileReader>(); | |
var writer = Substitute.For<IFileWriter>(); | |
var subject = new FileTransformer(reader, writer){Logger = logger}; | |
before = () => subject.Shazam(); | |
specify = () => logger.Received().Info(Arg.Any<String>()); | |
specify = () => reader.Received().Read(); | |
specify = () => writer.Received().Write(Arg.Any<string[]>()); | |
} | |
} |
This file contains 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
transforming files | |
with a file transformer | |
logger Received Info Any | |
reader Received Read | |
writer Received Write Any | |
3 Examples, 0 Failed, 0 Pending |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment