BusinessLogic.Tests.UnitTests.LogicTests.ChampionsTests.ChampionRecalculatorTests.RecalculateChampionTests.ItSetsThePreviousChampionIfTheCurrentOneChangesButItIsTheSamePlayer C# (CSharp) Method

ItSetsThePreviousChampionIfTheCurrentOneChangesButItIsTheSamePlayer() private method

        public void ItSetsThePreviousChampionIfTheCurrentOneChangesButItIsTheSamePlayer()
        {
            ChampionData championData = new ChampionData {PlayerId = -1};
            _autoMocker.Get<IChampionRepository>().Expect(mock => mock.GetChampionData(_gameDefinitionId))
                .Return(championData);

            _autoMocker.Get<IDataContext>().Expect(mock => mock.GetQueryable<Champion>())
                .Return(new List<Champion>().AsQueryable());

            _autoMocker.ClassUnderTest.RecalculateChampion(_gameDefinitionId, _applicationUser);

            _autoMocker.Get<IDataContext>().AssertWasCalled(mock => mock.Save(
                Arg<GameDefinition>.Matches(definition => definition.PreviousChampionId == _previousChampionId),
                Arg<ApplicationUser>.Is.Same(_applicationUser)));
        }