Skip to content

Instantly share code, notes, and snippets.

@skoon
Created June 21, 2010 21:52
Show Gist options
  • Save skoon/447562 to your computer and use it in GitHub Desktop.
Save skoon/447562 to your computer and use it in GitHub Desktop.
public class when_retrieving_groups : BaseSpec
{
[Fact]
public void can_retrieve_all_groups()
{
Assert.NotEmpty(_groupsRepository.GetAll());
}
[Fact]
public void can_select_a_single_group_by_id()
{
Assert.NotNull(_groupsRepository.Get(1));
}
[Fact]
public void can_retrieve_the_groups_a_user_belongs_to()
{
Assert.NotEmpty(_userRepository.Get(_userId).Groups);
}
}
public class BaseSpec
{
internal SessionFactoryCreator _sessionFactoryCreator;
internal GroupRepository _groupsRepository;
internal UserRepository _userRepository;
protected const int _userId = 14;
public BaseSpec()
{
_sessionFactoryCreator = new SessionFactoryCreator();
_groupsRepository = new GroupRepository(_sessionFactoryCreator);
_userRepository = new UserRepository(_sessionFactoryCreator);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment