CheatSheet
RonnieHegelund edited this page Dec 12, 2012
·
2 revisions
This page contains short code snippets that demonstrate AutoFixture features. All examples assume that a Fixture instance called fixture has previously been created like this:
var sut = new AutofixtureTS.Fixture();
var result = sut.CreateAnonymous("");
###Sample Result string: "5E9963D5-757C-355C-0322-3E3627892F36"
###Seeded String
var anonymousName = sut.CreateAnonymous("Name");
###Sample Result string: "Name5E9963D5-757C-355C-0322-3E3627892F36"
###Sequence of Strings
var strings = sut.CreateMany("");
###Sample Result string[]:
-> string: "5E9963D5-757C-355C-0322-3E3627892F36"
-> string: "4B5F84D3-1DE8-4FD7-89D4-1D1154CF80B7"
-> string: "D356ADB3-6650-4D31-98B3-366A65EA88AB"
var anonymousNumber = sut.CreateAnonymous(0);
###Sample Result number: 1, followed by 2, the by 3 etc.