Ejemplo n.º 1
0
        public void SetUp()
        {
            m_Bus        = Substitute.For <IBus>();
            m_Id         = new PlayerId();
            m_VesselRepo = Substitute.For <IVesselRepository>();

            m_Repository = new SelectableObjectRepository(m_Bus, m_Id, m_VesselRepo);

            m_Position = new Vector(5, 7);
            m_TestTime = 500;

            m_SelectableObject = CreateSelectableObjectAt(m_Position);

            m_Repository.AddObject(m_SelectableObject);
        }
Ejemplo n.º 2
0
        public void ClearsOldSelectedObject()
        {
            var message = new SelectObjectAtMessage(m_Position, m_TestTime);

            var newPosition = new Vector(50, 5);

            var secondObject = CreateSelectableObjectAt(newPosition);

            m_Repository.AddObject(secondObject);
            m_Repository.OnSelectObject(message);

            m_Bus.DidNotReceive().Send(Arg.Any <DeselectedObjectMessage>());

            m_Repository.OnSelectObject(new SelectObjectAtMessage(newPosition, m_TestTime));

            m_Bus.Received().Send(Arg.Any <DeselectedObjectMessage>());
        }
        public void SetUp()
        {
            m_Bus = Substitute.For<IBus>();
            m_Id = new PlayerId();
            m_VesselRepo = Substitute.For<IVesselRepository>();

            m_Repository = new SelectableObjectRepository(m_Bus, m_Id, m_VesselRepo);

            m_Position = new Vector(5, 7);
            m_TestTime = 500;

            m_SelectableObject = CreateSelectableObjectAt(m_Position);

            m_Repository.AddObject(m_SelectableObject);
        }