Exemplo n.º 1
0
        public void getRefTest()
        {
            InstanceMemory mem = new InstanceMemory();
            Station testStation = new TestStation();

            TestInstance1 t1 = new TestInstance1("123", "123-abc", "FILLED");
            TestInstance1 t2 = new TestInstance1("123", "123-def", "UNFILLED");
            TestInstance1 t3 = new TestInstance1("456", "456-abc", "NEW");
            TestInstance1 t4 = new TestInstance1("789", "789-abc", "FILLED");

            InstanceRef i1 = mem.AddRef(t1, testStation);
            InstanceRef i2 = mem.AddRef(t2, testStation);
            InstanceRef i3 = mem.AddRef(t3, testStation);
            InstanceRef i4 = mem.AddRef(t4, testStation);
            InstanceRef i2b = mem.AddRef(t2, testStation);
            InstanceRef i1c = mem.AddRef(t1, testStation);

            InstanceRef expected = i2b;
            InstanceRef actual;
            actual = mem.GetRef(i2b.Id);
            Assert.AreEqual(expected, actual);

            Assert.AreEqual("UNFILLED", actual.Instance.Status);
            Assert.AreEqual("123", actual.Instance.ID);
            Assert.AreEqual(t2, actual.Instance);
        }
Exemplo n.º 2
0
 internal virtual Station CreateTestStation()
 {
     ConfigData stationConfig = new ConfigData(configStream);
     Station target = new TestStation();
     target.Initialize(stationConfig, memory, null);
     return target;
 }