Beispiel #1
0
        static TestEntities()
        {
            TestPlayer  = new PlayerCharacter(-All.PlayerCharacterIDs.Minimum, "0", "Test Player", "Test", "Test");
            TestCritter = new Critter(-All.CritterIDs.Minimum, "1 Test Critter", "Test", "Test",
                                      All.BiomeIDs.Minimum, Behavior.Still);
            TestNPC = new NPC(-All.NpcIDs.Minimum, "2", "Test NPC", "Test", "Test",
                              All.BiomeIDs.Minimum, Behavior.Still);
            TestFloor      = new Floor(-All.FloorIDs.Minimum, "3 Test Floor", "Test", "Test", in_addsToRoom: TestTag);
            TestBlock      = new Block(-All.BlockIDs.Minimum, "4 Test Block", "Test", "Test", in_addsToRoom: TestTag);
            TestFurnishing = new Furnishing(-All.FurnishingIDs.Minimum, "5 Test Furnishing", "Test", "Test",
                                            in_isEntry: true, in_addsToRoom: TestTag);
            TestCollectible = new Collectible(-All.CollectibleIDs.Minimum, "6 Test Collectible", "Test", "Test",
                                              in_addsToRoom: TestTag);
            TestRoomRecipe = new RoomRecipe(-All.RoomRecipeIDs.Minimum - 1, "7 Test Room Recipe", "Test", "Test",
                                            TestRecipeElementList, All.Recipes.Rooms.MinWalkableSpaces + 1,
                                            TestRecipeElementList, TestRecipeElementList);
            TestCraftingRecipe = new CraftingRecipe(-All.CraftingRecipeIDs.Minimum, "8 Test Crafting Recipe",
                                                    "Test", "Test",
                                                    TestRecipeElementList, TestRecipeElementList,
                                                    new StrikePanel[All.Dimensions.PanelsPerPatternHeight,
                                                                    All.Dimensions.PanelsPerPatternWidth]);
            //TestQuest = new Quest(-All.QuestIDs.Minimum, "9 Test Quest", "Test", "Test");
            TestBiome = new Biome(-All.BiomeIDs.Minimum, "10 Test Biome", "Test", "Test",
                                  1, Elevation.LevelGround, false, null, null);
            TestItem = new Item(-All.ItemIDs.Minimum, ItemType.Other, "11 Test Item", "Test", "Test",
                                1, 0, 99, 1, 1, -All.BlockIDs.Minimum);

            // Sets up All so that bounds can be checked in various constructors.
            Parquets = new List <ParquetParent> {
                TestFloor, TestBlock, TestFurnishing, TestCollectible
            };
            All.InitializeCollections(Parquets);
        }
Beispiel #2
0
        internal void NullRequiredFurnishingsThrowsTest()
        {
            void NullRequiredFurnishings()
            {
                var _ = new RoomRecipe(-All.RoomRecipeIDs.Minimum, "will fail", "", "", null);
            }

            Assert.Throws <ArgumentNullException>(NullRequiredFurnishings);
        }
Beispiel #3
0
        internal void EmptyRequiredFurnishingsThrowsTest()
        {
            void EmptyRequiredFurnishings()
            {
                var _ = new RoomRecipe(-All.RoomRecipeIDs.Minimum, "will fail", "", "",
                                       new List <RecipeElement>());
            }

            Assert.Throws <IndexOutOfRangeException>(EmptyRequiredFurnishings);
        }
Beispiel #4
0
        internal void MinimumWalkableSpacesAboveGlobalMaximumThrowsTest()
        {
            var BadMinimum = All.Recipes.Rooms.MaxWalkableSpaces + 1;

            void HasBadRequiredBlocks()
            {
                var _ = new RoomRecipe(-All.RoomRecipeIDs.Minimum, "will fail", "", "",
                                       TestRequiredFurnishings, BadMinimum);
            }

            Assert.Throws <ArgumentOutOfRangeException>(HasBadRequiredBlocks);
        }