public void InspectCommand_InspectSpaceWithContainer_NotifiesContainer() { var container = new ValuablesContainer { ObjectLayer = ObjectLayer.LowerObject }; _layer[0, 0].Put(container); var command = new InspectCommand(_map, new XYZ(0, 0, 0), this); command.Go(); Assert.AreEqual(container, _containers.First()); }
public void FacilitySpace_ValuableInContainer_ReturnsCorrectly() { var space = new FacilitySpace(); var container = new ValuablesContainer { ObjectLayer = ObjectLayer.LowerObject }; container.Put(new Valuable { Type = "Diamond" }); space.Put(container); var valuables = space.Valuables.ToList(); Assert.AreEqual(1, valuables.Count()); Assert.IsTrue(valuables.Any(x => x.Type.Equals("Diamond"))); }
public void FacilityMap_Valuables_AreCorrect() { _map.Add(_sampleLayer); var value1 = new ValuableFacilityObject { Type = "Painting", ObjectLayer = ObjectLayer.UpperObject }; var container = new ValuablesContainer { Type = "Table", ObjectLayer = ObjectLayer.LowerObject }; var value2 = new Valuable { Type = "Diamond" }; container.Put(value2); _map[5, 5, 0].Put(value1); _map[7, 8, 0].Put(container); var valuables = _map.SpatialValuables.ToList(); Assert.AreEqual(2, valuables.Count); Assert.IsTrue(valuables.Any(x => x.Obj.Type.Equals("Painting"))); Assert.IsTrue(valuables.Any(x => x.Obj.Type.Equals("Diamond"))); }
public void Init() { _container = new ValuablesContainer(); _sampleValuable = new Valuable(); }
public void Notify(ValuablesContainer container) { _containers.Add(container); }