use of win.baruna.blockmeter.BlockMeterClient in project BlockMeter by ModProg.
the class ClientMeasureBoxTest method testIsCorner.
@ParameterizedTest
@JSONSource(classes = { ParseBlockPos.class, ParseBlockPos.class, ParseBlockPos.class, ParseBlockPos.class, ParseBlockPos.class, ParseBlockPos.class, ParseBlockPos.class, ParseBlockPos.class }, jsons = { "(0|0|0), (10|10|10), (0|0|10), (0|10|0), (0|10|10), (10|0|0), (10|0|10), (10|10|0)", "(-30|5|25), (-90|2|50), (-30|5|50), (-30|2|25), (-30|2|50), (-90|5|25), (-90|5|50), (-90|2|25)" })
void testIsCorner(BlockPos bp0, BlockPos bp1, BlockPos bp2, BlockPos bp3, BlockPos bp4, BlockPos bp5, BlockPos bp6, BlockPos bp7) {
try (MockedStatic<BlockMeterClient> client = getBMC()) {
final ClientMeasureBox box = ClientMeasureBox.getBox(bp0, OVERWORLD_ID);
box.setBlockEnd(bp1);
assertThat(box.isCorner(bp0));
assertThat(box.isCorner(bp1));
assertThat(box.isCorner(bp2));
assertThat(box.isCorner(bp3));
assertThat(box.isCorner(bp4));
assertThat(box.isCorner(bp5));
assertThat(box.isCorner(bp6));
assertThat(box.isCorner(bp7));
}
}
use of win.baruna.blockmeter.BlockMeterClient in project BlockMeter by ModProg.
the class ClientMeasureBoxTest method testFinished.
@Test
void testFinished() {
try (MockedStatic<BlockMeterClient> client = getBMC()) {
final ClientMeasureBox box = ClientMeasureBox.getBox(new BlockPos(0, 0, 0), OVERWORLD_ID);
assertThat(box.isFinished()).isFalse();
box.setFinished();
assertThat(box.isFinished()).isTrue();
}
}
use of win.baruna.blockmeter.BlockMeterClient in project BlockMeter by ModProg.
the class ClientMeasureBoxTest method testSetBlockEnd.
@ParameterizedTest
@JSONSource(classes = { ParseBlockPos.class, ParseBlockPos.class }, jsons = { "(0|0|0), (0|0|0)", "(-10|0|10000), (-500|0|10200)" })
void testSetBlockEnd(final BlockPos bp0, final BlockPos bp1) {
try (MockedStatic<BlockMeterClient> client = getBMC()) {
final ClientMeasureBox box = ClientMeasureBox.getBox(bp0, OVERWORLD_ID);
box.setBlockEnd(bp1);
assertThat(box.getBlockStart()).isEqualTo(bp0);
assertThat(box.getBlockEnd()).isEqualTo(bp1);
}
}
use of win.baruna.blockmeter.BlockMeterClient in project BlockMeter by ModProg.
the class ClientMeasureBoxTest method testSetColor.
@ParameterizedTest
@JSONSource(classes = { ParseDyeColor.class }, jsons = { "red", "black", "green", "blue" })
void testSetColor(final DyeColor color) {
try (MockedStatic<BlockMeterClient> client = getBMC()) {
final ClientMeasureBox box = ClientMeasureBox.getBox(new BlockPos(0, 0, 0), OVERWORLD_ID);
box.setColor(color);
assertThat(box.getColor()).isEqualTo(color);
}
}
use of win.baruna.blockmeter.BlockMeterClient in project BlockMeter by ModProg.
the class ClientMeasureBoxTest method testLoosenCorner.
@ParameterizedTest
@JSONSource(classes = { ParseBlockPos.class, ParseBlockPos.class, ParseBlockPos.class }, jsons = { "(0|1|2), (3|4|5), (0|4|2)" })
void testLoosenCorner(BlockPos bp0, BlockPos bp1, BlockPos newBp0) {
try (MockedStatic<BlockMeterClient> client = getBMC()) {
final ClientMeasureBox box = ClientMeasureBox.getBox(bp0, OVERWORLD_ID);
box.setBlockEnd(bp1);
box.setFinished();
box.loosenCorner(newBp0);
assertThat(box.isCorner(bp0)).isTrue();
assertThat(box.isCorner(bp1)).isTrue();
assertThat(box.getBlockEnd()).isEqualTo(newBp0);
assertThat(box.isFinished()).isFalse();
}
}
Aggregations