コード例 #1
0
ファイル: PickupEventTest.cs プロジェクト: boschbc/NaoRobot
 public void Init()
 {
     Logger.Clear();
     inputStream = EventTestingUtilities.BuildStream(ExpectedID);
     goalComs.SetStream(inputStream);
     pickupEvent = new PickupEvent();
 }
コード例 #2
0
        /// <summary>
        /// Creates a stream and fill it with data.
        /// </summary>
        /// <param name="input">Data which will be writen into the stream.</param>
        /// <returns>A new communication stream.</returns>
        public static CommunicationStream BuildStream(params int[] input)
        {
            MemoryStream        mem = new MemoryStream();
            CommunicationStream com = new CommunicationStream(mem);

            foreach (int i in input)
            {
                com.WriteInt(i);
            }
            mem.Position = 0;  //Bring the seeker back to the start.
            return(com);
        }
コード例 #3
0
ファイル: GoToEventTest.cs プロジェクト: boschbc/NaoRobot
        public void UnpackTest()
        {
            CommunicationStream stream = EventTestingUtilities.BuildStream(
                1, 15, 15
                );

            goalComs.SetStream(stream);
            goToEvent = new GoToEvent();
            List <Point> nodes = (List <Point>)EventTestingUtilities.GetInstanceField(typeof(GoToEvent), goToEvent, "locations");

            Assert.AreEqual(new Point(1, 1), nodes[0]);
        }
コード例 #4
0
        public void Init()
        {
            int objectID = 43;  //Dummy

            exitInputStream    = EventTestingUtilities.BuildStream();
            putDownInputStream = EventTestingUtilities.BuildStream();
            goToInputStream    = EventTestingUtilities.BuildStream(0, objectID, 0);
            pickupInputStream  = EventTestingUtilities.BuildStream(objectID);
            haltInputStream    = EventTestingUtilities.BuildStream();
            invalidInputStream = EventTestingUtilities.BuildStream(-1);
            invalidEventCode   = 99;
        }
コード例 #5
0
 public override void Initialize()
 {
     stream = new CommunicationStream(internalStream);
 }
コード例 #6
0
 public void SetUp()
 {
     mem    = new MemoryStream();
     stream = new CommunicationStream(mem);
     coms   = new GoalComsStub(stream);
 }
コード例 #7
0
 public void SetStream(CommunicationStream coms)
 {
     this.coms = coms;
 }
コード例 #8
0
 public GoalComsStub(CommunicationStream coms) : base("127.0.0.1", 0)
 {
     this.coms = coms;
     GoalCommunicator.Instance = this;
 }
コード例 #9
0
ファイル: PutDownEventTest.cs プロジェクト: boschbc/NaoRobot
 public void initOnce()
 {
     emptyStream = EventTestingUtilities.BuildStream();
     goalComs    = new GoalComsStub(emptyStream);
 }