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); }
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); }
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); }
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); }