Created
June 21, 2010 21:52
-
-
Save skoon/447562 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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