예제 #1
0
 public void Init()
 {
     Logger.Clear();
     inputStream = EventTestingUtilities.BuildStream(ExpectedID);
     goalComs.SetStream(inputStream);
     pickupEvent = new PickupEvent();
 }
예제 #2
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;
 }
예제 #3
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;
        }
예제 #4
0
 public void SetUp()
 {
     mem = new MemoryStream();
     stream = new CommunicationStream(mem);
     coms = new GoalComsStub(stream);
 }
예제 #5
0
 public void initOnce()
 {
     emptyStream = EventTestingUtilities.BuildStream();
     goalComs = new GoalComsStub(emptyStream);
 }
예제 #6
0
 public void SetStream(CommunicationStream coms)
 {
     this.coms = coms;
 }
예제 #7
0
 public GoalComsStub(CommunicationStream coms)
     : base("127.0.0.1", 0)
 {
     this.coms = coms;
     GoalCommunicator.Instance = this;
 }
 public override void Initialize()
 {
     stream = new CommunicationStream(internalStream);
 }