﻿using System.Collections.Generic;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;
using NFluent;
using SmallWorld.BusinessEntities.Football.DeedDetectors;
using SmallWorld.BusinessEntities.Interfaces.Football.Agents;

namespace SmallWorld.BusinessEntities.UnitTests.Football.DeedDetectors
{
    [TestClass]
    public class MoveDetectorTest
    {
        [TestMethod]
        public void When_Detect_Then_Return_MoveDeed_For_All_SensedPlayer_With_Origin_As_Origin()
        {
            var moveDetector = new MoveDetector();

            var origin = new Mock<IFootballPlayer>();
          
            var playerOne = new Mock<IFootballPlayer>();
            var playerTwo = new Mock<IFootballPlayer>();
         
            var sensedPlayers = new List<IFootballPlayer>
            {
                playerOne.Object, playerTwo.Object
            };

            var result = moveDetector.Detect(origin.Object, sensedPlayers);

            foreach (var tmpFootballDeed in result)
            {
                Check.That(tmpFootballDeed.Player).IsSameReferenceThan(origin.Object);
            }
        }
    }
}
