Exemplo n.º 1
0
        public void FacilitySpace_RemoveByLayer_ObjectRemoved()
        {
            var space = new FacilitySpace {
                Ground = new FacilityObject {
                    Type = "Floor", ObjectLayer = ObjectLayer.Ground
                }
            };

            space.Remove(ObjectLayer.Ground);

            Assert.AreEqual("None", space.Ground.Type);
        }
Exemplo n.º 2
0
        public void FacilitySpace_RemoveValuable_ObserverNotified()
        {
            var space    = new FacilitySpace();
            var obs      = new SimpleObserver <FacilitySpace>();
            var valuable = new ValuableFacilityObject {
                Type = "Vase", ObjectLayer = ObjectLayer.LowerObject
            };

            space.Put(valuable);
            space.Subscribe(obs);

            space.Remove((IValuable)valuable);

            Assert.AreEqual(space, obs.LastUpdate);
        }
Exemplo n.º 3
0
        public void FacilitySpace_RemoveObjectLayer_ObserverNotified()
        {
            var space = new FacilitySpace();
            var obs   = new SimpleObserver <FacilitySpace>();
            var obj   = new FacilityObject {
                Type = "Floor", ObjectLayer = ObjectLayer.Ground
            };

            space.Put(obj);
            space.Subscribe(obs);

            space.Remove(ObjectLayer.Ground);

            Assert.AreEqual(space, obs.LastUpdate);
        }
Exemplo n.º 4
0
        public void FacilitySpace_NoValuableRemoved_ObserverNotNotified()
        {
            var space = new FacilitySpace();
            var obs   = new SimpleObserver <FacilitySpace>();
            var obj   = new FacilityObject {
                Type = "Floor", ObjectLayer = ObjectLayer.Ground
            };

            space.Put(obj);
            space.Subscribe(obs);

            space.Remove(new FacilityObject {
                Type = "Door"
            });

            Assert.AreEqual(0, obs.UpdateCount);
        }