Skip to content

Instantly share code, notes, and snippets.

@ryansroberts
Created July 20, 2010 17:36
Show Gist options
  • Save ryansroberts/483264 to your computer and use it in GitHub Desktop.
Save ryansroberts/483264 to your computer and use it in GitHub Desktop.
public class When_searching_for_a_tag_by_name_with_two_matches : HandlerContext<IEnumerable<TagResource>, TagsController>
{
Establish context = () => Stub<ISemaphoreService>()
.Setup(s => s.ByName(Moq.It.IsAny<string>()))
.Returns(new[] { new Term(1, "encoded term that is ambiguous"),
new Term(2, "encoded term that is ambiguous") });
Because of = () => Get("tags/byname/encoded+term+that+is+ambiguous");
It Has_a_resource_of_enumerable_tags = () => Has_expected_resource_type();
It Has_returned_two_results = () => Resource.Count().ShouldEqual(2);
It Matches_the_second_searched_for_term = () => Resource.ElementAt(1).Id.ShouldEqual(2);
It Matches_the_second_semaphore_id = () => Resource.ElementAt(1).Id.ShouldEqual(2);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment