public void SetUp()
{
dataContextMock = MockRepository.GenerateMock<IDataContext>();
contextSwitcher = new GamingGroupContextSwitcher(dataContextMock);
currentUser = new ApplicationUser
{
Id = "user id",
CurrentGamingGroupId = 777
};
retrievedUser = new ApplicationUser
{
Id = "user id"
};
userGamingGroups = new List<UserGamingGroup>
{
new UserGamingGroup
{
Id = 1,
ApplicationUserId = currentUser.Id,
GamingGroupId = gamingGroupIdUserCanSee
},
new UserGamingGroup
{
Id = 2,
ApplicationUserId = "some other id the user cant see",
GamingGroupId = gamingGroupIdUserCanSee
}
};
dataContextMock.Expect(mock => mock.GetQueryable<UserGamingGroup>())
.Return(userGamingGroups.AsQueryable());
dataContextMock.Expect(mock => mock.FindById<ApplicationUser>(currentUser.Id))
.Return(retrievedUser);
}