public void ItCreatesAnApplicationLinkageForEachSpecifiedApplicationLinkage()
{
//--arrange
var newlyCompletedPlayedGame = CreateValidNewlyCompletedGame();
var expectedApplicationLinkage1 = new ApplicationLinkage
{
ApplicationName = "app1",
EntityId = "1"
};
var expectedApplicationLinkage2 = new ApplicationLinkage
{
ApplicationName = "app2",
EntityId = "2"
};
newlyCompletedPlayedGame.ApplicationLinkages = new List<ApplicationLinkage>
{
expectedApplicationLinkage1,
expectedApplicationLinkage2
};
var expectedPlayedGame = new PlayedGame
{
Id = EXPECTED_PLAYED_GAME_ID
};
autoMocker.ClassUnderTest.Expect(partialMock => partialMock.TransformNewlyCompletedGameIntoPlayedGame(null, 0, null, null))
.IgnoreArguments()
.Return(expectedPlayedGame);
//--act
autoMocker.ClassUnderTest.CreatePlayedGame(newlyCompletedPlayedGame, TransactionSource.WebApplication, currentUser);
//--assert
autoMocker.Get<IApplicationLinker>().AssertWasCalled(mock => mock.LinkApplication(
EXPECTED_PLAYED_GAME_ID,
expectedApplicationLinkage1.ApplicationName,
expectedApplicationLinkage1.EntityId));
autoMocker.Get<IApplicationLinker>().AssertWasCalled(mock => mock.LinkApplication(
EXPECTED_PLAYED_GAME_ID,
expectedApplicationLinkage2.ApplicationName,
expectedApplicationLinkage2.EntityId));
}