Exemplo n.º 1
0
 public void Init()
 {
     Logger.Clear();
     inputStream = EventTestingUtilities.BuildStream(ExpectedID);
     goalComs.SetStream(inputStream);
     pickupEvent = new PickupEvent();
 }
Exemplo n.º 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;
 }
Exemplo n.º 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;
        }
Exemplo n.º 4
0
 public void SetUp()
 {
     mem = new MemoryStream();
     stream = new CommunicationStream(mem);
     coms = new GoalComsStub(stream);
 }
Exemplo n.º 5
0
 public void initOnce()
 {
     emptyStream = EventTestingUtilities.BuildStream();
     goalComs = new GoalComsStub(emptyStream);
 }
Exemplo n.º 6
0
 public void SetStream(CommunicationStream coms)
 {
     this.coms = coms;
 }
Exemplo n.º 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);
 }