Skip to content

Instantly share code, notes, and snippets.

Created October 13, 2011 02:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/1283162 to your computer and use it in GitHub Desktop.
Save anonymous/1283162 to your computer and use it in GitHub Desktop.
Good test/ bad test?
[TestMethod]
public void GetContextId_OnSecondRun_ShouldReturnStoredContextId()
{
const string firstContextId = "200";
const string secondContextId = "400";
var contextRecord = new ContextRecord();
fakeRecordGenerator.GeneratRecord().Returns(contextRecord);
fakeContextService.CreateContextRecord(contextRecord).Returns(firstContextId);
contextManager.GetContextId();
fakeContextService.CreateContextRecord(contextRecord).Returns(secondContextId);
var resultContextId = contextManager.GetContextId();
Assert.AreEqual(firstContextId, resultContextId);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment