public void It_Sets_The_Gaming_Group_Information()
{
const int EXPECTED_GAMING_GROUP_ID_1 = 1;
const string EXPECTED_GAMING_GROUP_NAME_1 = "gaming group name 1";
const string EXPECTED_URL = "gaming group name 1";
const string EXPECTED_DESCRIPTION = "gaming group name 1";
expectedApplicationUser = new ApplicationUser
{
Id = "some application user id",
UserGamingGroups = new List<UserGamingGroup>
{
new UserGamingGroup
{
GamingGroup = new GamingGroup
{
Id = EXPECTED_GAMING_GROUP_ID_1,
Name = EXPECTED_GAMING_GROUP_NAME_1,
PublicGamingGroupWebsite = EXPECTED_URL,
PublicDescription = EXPECTED_DESCRIPTION
}
},
new UserGamingGroup
{
GamingGroup = new GamingGroup()
}
},
Players = new List<Player>(),
BoardGameGeekUser = null
};
var userQueryable = new List<ApplicationUser>
{
expectedApplicationUser
}.AsQueryable();
autoMocker.Get<IDataContext>().Expect(mock => mock.GetQueryable<ApplicationUser>()).Return(userQueryable);
var actualResult = autoMocker.ClassUnderTest.RetrieveUserInformation(expectedApplicationUser);
Assert.That(actualResult.GamingGroups.Count, Is.EqualTo(2));
var actualGamingGroupInfo = actualResult.GamingGroups[0];
Assert.That(actualGamingGroupInfo.GamingGroupId, Is.EqualTo(EXPECTED_GAMING_GROUP_ID_1));
Assert.That(actualGamingGroupInfo.GamingGroupName, Is.EqualTo(EXPECTED_GAMING_GROUP_NAME_1));
Assert.That(actualGamingGroupInfo.GamingGroupPublicUrl, Is.EqualTo(EXPECTED_URL));
Assert.That(actualGamingGroupInfo.GamingGroupPublicDescription, Is.EqualTo(EXPECTED_DESCRIPTION));
Assert.That(actualResult.UserId, Is.EqualTo(expectedApplicationUser.Id));
}