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