コード例 #1
0
        public void Main_tile_Get_Height_Get()
        {
            var events = Mock.Of <IEventManager>();
            var log    = Mock.Of <ILogger>();

            using var world = new OrionWorld(events, log);

            Assert.Equal(Terraria.Main.maxTilesY, Terraria.Main.tile.Height);
        }
コード例 #2
0
        public void Main_tile_Get_liquid_Set()
        {
            var events = Mock.Of <IEventManager>();
            var log    = Mock.Of <ILogger>();

            using var world = new OrionWorld(events, log);

            Terraria.Main.tile[0, 0].liquid = 100;

            Assert.Equal(100, world[0, 0].Liquid.Amount);
        }
コード例 #3
0
        public void Main_tile_Get_wall_Set()
        {
            var events = Mock.Of <IEventManager>();
            var log    = Mock.Of <ILogger>();

            using var world = new OrionWorld(events, log);

            Terraria.Main.tile[0, 0].wall = (ushort)WallId.Stone;

            Assert.Equal(WallId.Stone, world[0, 0].WallId);
        }
コード例 #4
0
        public void Main_tile_Get_frameNumber_Set_Get()
        {
            var events = Mock.Of <IEventManager>();
            var log    = Mock.Of <ILogger>();

            using var world = new OrionWorld(events, log);

            Terraria.Main.tile[0, 0].frameNumber(2);

            Assert.Equal(2, Terraria.Main.tile[0, 0].frameNumber());
        }
コード例 #5
0
        public void Main_tile_Get_skipLiquid_Set_Get(bool value)
        {
            var events = Mock.Of <IEventManager>();
            var log    = Mock.Of <ILogger>();

            using var world = new OrionWorld(events, log);

            Terraria.Main.tile[0, 0].skipLiquid(value);

            Assert.Equal(value, Terraria.Main.tile[0, 0].skipLiquid());
        }
コード例 #6
0
        public void Main_tile_Get_active_SetFalse()
        {
            var events = Mock.Of <IEventManager>();
            var log    = Mock.Of <ILogger>();

            using var world = new OrionWorld(events, log);

            Terraria.Main.tile[0, 0].active(false);

            Assert.Equal(BlockId.None, world[0, 0].BlockId);
        }
コード例 #7
0
        public void Main_tile_Get_wallColor_Set()
        {
            var events = Mock.Of <IEventManager>();
            var log    = Mock.Of <ILogger>();

            using var world = new OrionWorld(events, log);

            Terraria.Main.tile[0, 0].wallColor((byte)PaintColor.DeepRed);

            Assert.Equal(PaintColor.DeepRed, world[0, 0].WallColor);
        }
コード例 #8
0
        public void Main_tile_Get_wire4_Set(bool value)
        {
            var events = Mock.Of <IEventManager>();
            var log    = Mock.Of <ILogger>();

            using var world = new OrionWorld(events, log);

            Terraria.Main.tile[0, 0].wire4(value);

            Assert.Equal(value, world[0, 0].HasYellowWire);
        }
コード例 #9
0
        public void Main_tile_Get_liquidType_Set(LiquidType value)
        {
            var events = Mock.Of <IEventManager>();
            var log    = Mock.Of <ILogger>();

            using var world = new OrionWorld(events, log);

            Terraria.Main.tile[0, 0].liquidType((int)value);

            Assert.Equal(value, world[0, 0].Liquid.Type);
        }
コード例 #10
0
        public void Main_tile_Get_inActive_Set(bool value)
        {
            var events = Mock.Of <IEventManager>();
            var log    = Mock.Of <ILogger>();

            using var world = new OrionWorld(events, log);

            Terraria.Main.tile[0, 0].inActive(value);

            Assert.Equal(value, world[0, 0].IsBlockActuated);
        }
コード例 #11
0
        public void Main_tile_Get_frameY_Set()
        {
            var events = Mock.Of <IEventManager>();
            var log    = Mock.Of <ILogger>();

            using var world = new OrionWorld(events, log);

            Terraria.Main.tile[0, 0].frameY = 12345;

            Assert.Equal(12345, world[0, 0].BlockFrameY);
        }
コード例 #12
0
        public void Main_tile_Get_actuator_Set(bool value)
        {
            var events = Mock.Of <IEventManager>();
            var log    = Mock.Of <ILogger>();

            using var world = new OrionWorld(events, log);

            Terraria.Main.tile[0, 0].actuator(value);

            Assert.Equal(value, world[0, 0].HasActuator);
        }
コード例 #13
0
        public void Main_tile_Get_slope_SetNonZero()
        {
            var events = Mock.Of <IEventManager>();
            var log    = Mock.Of <ILogger>();

            using var world = new OrionWorld(events, log);

            Terraria.Main.tile[0, 0].slope((byte)(BlockShape.TopRight - 1));

            Assert.Equal(BlockShape.TopRight, world[0, 0].BlockShape);
        }
コード例 #14
0
        public void Main_tile_Get_halfBrick_SetTrue()
        {
            var events = Mock.Of <IEventManager>();
            var log    = Mock.Of <ILogger>();

            using var world = new OrionWorld(events, log);

            Terraria.Main.tile[0, 0].halfBrick(true);

            Assert.Equal(BlockShape.Halved, world[0, 0].BlockShape);
        }
コード例 #15
0
        public void Main_tile_Get_type_SetZero()
        {
            var events = Mock.Of <IEventManager>();
            var log    = Mock.Of <ILogger>();

            using var world = new OrionWorld(events, log);

            Terraria.Main.tile[0, 0].active(true);
            Terraria.Main.tile[0, 0].type = (ushort)(BlockId.Dirt - 1);

            Assert.Equal(BlockId.Dirt, world[0, 0].BlockId);
        }
コード例 #16
0
        public void Main_tile_Get_honey_Get_ReturnsTrue()
        {
            var events = Mock.Of <IEventManager>();
            var log    = Mock.Of <ILogger>();

            using var world = new OrionWorld(events, log);

            world[0, 0] = new Tile {
                Liquid = new Liquid(LiquidType.Honey, 255)
            };

            Assert.True(Terraria.Main.tile[0, 0].honey());
        }
コード例 #17
0
        public void Main_tile_Get_liquidType_Get(LiquidType value)
        {
            var events = Mock.Of <IEventManager>();
            var log    = Mock.Of <ILogger>();

            using var world = new OrionWorld(events, log);

            world[0, 0] = new Tile {
                Liquid = new Liquid(value, 255)
            };

            Assert.Equal((byte)value, Terraria.Main.tile[0, 0].liquidType());
        }
コード例 #18
0
        public void Main_tile_Get_halfBrick_Get_ReturnsFalse()
        {
            var events = Mock.Of <IEventManager>();
            var log    = Mock.Of <ILogger>();

            using var world = new OrionWorld(events, log);

            world[0, 0] = new Tile {
                BlockShape = BlockShape.TopRight
            };

            Assert.False(Terraria.Main.tile[0, 0].halfBrick());
        }
コード例 #19
0
        public void Main_tile_Get_nactive_Get_ReturnsTrue()
        {
            var events = Mock.Of <IEventManager>();
            var log    = Mock.Of <ILogger>();

            using var world = new OrionWorld(events, log);

            world[0, 0] = new Tile {
                BlockId = BlockId.Dirt
            };

            Assert.True(Terraria.Main.tile[0, 0].nactive());
        }
コード例 #20
0
        public void Main_tile_Get_rightSlope(BlockShape shape, bool value)
        {
            var events = Mock.Of <IEventManager>();
            var log    = Mock.Of <ILogger>();

            using var world = new OrionWorld(events, log);

            world[0, 0] = new Tile {
                BlockShape = shape
            };

            Assert.Equal(value, Terraria.Main.tile[0, 0].rightSlope());
        }
コード例 #21
0
        public void Main_tile_Get_slope_GetNotNormal()
        {
            var events = Mock.Of <IEventManager>();
            var log    = Mock.Of <ILogger>();

            using var world = new OrionWorld(events, log);

            world[0, 0] = new Tile {
                BlockShape = BlockShape.TopRight
            };

            Assert.Equal((int)(BlockShape.TopRight - 1), Terraria.Main.tile[0, 0].slope());
        }
コード例 #22
0
        public void Main_tile_Get_liquid_Get()
        {
            var events = Mock.Of <IEventManager>();
            var log    = Mock.Of <ILogger>();

            using var world = new OrionWorld(events, log);

            world[0, 0] = new Tile {
                Liquid = new Liquid(LiquidType.Water, 100)
            };

            Assert.Equal(100, Terraria.Main.tile[0, 0].liquid);
        }
コード例 #23
0
        public void Main_tile_Get_honey_Get_ReturnsFalse()
        {
            var events = Mock.Of <IEventManager>();
            var log    = Mock.Of <ILogger>();

            using var world = new OrionWorld(events, log);

            world[0, 0] = new Tile {
                Liquid = default
            };

            Assert.False(Terraria.Main.tile[0, 0].honey());
        }
コード例 #24
0
        public void Main_tile_Get_wall_Get()
        {
            var events = Mock.Of <IEventManager>();
            var log    = Mock.Of <ILogger>();

            using var world = new OrionWorld(events, log);

            world[0, 0] = new Tile {
                WallId = WallId.Stone
            };

            Assert.Equal(WallId.Stone, (WallId)Terraria.Main.tile[0, 0].wall);
        }
コード例 #25
0
        public void Main_tile_Get_blockType_Get(BlockShape value)
        {
            var events = Mock.Of <IEventManager>();
            var log    = Mock.Of <ILogger>();

            using var world = new OrionWorld(events, log);

            world[0, 0] = new Tile {
                BlockShape = value
            };

            Assert.Equal(value, (BlockShape)Terraria.Main.tile[0, 0].blockType());
        }
コード例 #26
0
        public void Main_tile_Get_wallColor_Get()
        {
            var events = Mock.Of <IEventManager>();
            var log    = Mock.Of <ILogger>();

            using var world = new OrionWorld(events, log);

            world[0, 0] = new Tile {
                WallColor = PaintColor.Red
            };

            Assert.Equal((byte)PaintColor.Red, Terraria.Main.tile[0, 0].wallColor());
        }
コード例 #27
0
        public void Main_tile_Get_type_GetNone()
        {
            var events = Mock.Of <IEventManager>();
            var log    = Mock.Of <ILogger>();

            using var world = new OrionWorld(events, log);

            world[0, 0] = new Tile {
                BlockId = BlockId.None
            };

            Assert.Equal(0, Terraria.Main.tile[0, 0].type);
        }
コード例 #28
0
        public void Main_tile_Get_wire3_Get(bool value)
        {
            var events = Mock.Of <IEventManager>();
            var log    = Mock.Of <ILogger>();

            using var world = new OrionWorld(events, log);

            world[0, 0] = new Tile {
                HasGreenWire = value
            };

            Assert.Equal(value, Terraria.Main.tile[0, 0].wire3());
        }
コード例 #29
0
        public void Main_tile_Get_frameX_Get()
        {
            var events = Mock.Of <IEventManager>();
            var log    = Mock.Of <ILogger>();

            using var world = new OrionWorld(events, log);

            world[0, 0] = new Tile {
                BlockFrameX = 12345
            };

            Assert.Equal(12345, Terraria.Main.tile[0, 0].frameX);
        }
コード例 #30
0
        public void Main_tile_Get_honey_Set()
        {
            var events = Mock.Of <IEventManager>();
            var log    = Mock.Of <ILogger>();

            using var world = new OrionWorld(events, log);

            Terraria.Main.tile[0, 0].honey(false);

            Assert.NotEqual(LiquidType.Honey, world[0, 0].Liquid.Type);

            Terraria.Main.tile[0, 0].honey(true);

            Assert.Equal(LiquidType.Honey, world[0, 0].Liquid.Type);
        }