Ejemplo n.º 1
0
        public void can_toggle_isAbsent()
        {
            var building = Room <InsideBuilding>();
            var road     = Room <EndOfRoad>();

            var shoehorn = new ShoeHorn();

            shoehorn.Initialize();

            Assert.False(ObjectMap.Contains(building, shoehorn));
            Assert.False(ObjectMap.Contains(road, shoehorn));

            shoehorn.Absent = false;

            Assert.True(ObjectMap.Contains(building, shoehorn));
            Assert.True(ObjectMap.Contains(road, shoehorn));

            shoehorn.Absent = true;

            Assert.False(ObjectMap.Contains(building, shoehorn));
            Assert.False(ObjectMap.Contains(road, shoehorn));

            shoehorn.Absent = false;

            Assert.True(ObjectMap.Contains(building, shoehorn));
            Assert.True(ObjectMap.Contains(road, shoehorn));
        }
Ejemplo n.º 2
0
        public void can_take_one_object()
        {
            var bottle = Objects.Get <Bottle>();

            Execute("take bottle");

            Assert.Equal("Taken.", Line1);

            Assert.True(Inventory.Contains(bottle));

            Assert.False(ObjectMap.Contains(Location, bottle));
        }