package com.example.tests;
import com.frotty27.hrtk.api.annotation.HytaleSuite;
import com.frotty27.hrtk.api.annotation.WorldTest;
import com.frotty27.hrtk.api.annotation.Tag;
import com.frotty27.hrtk.api.annotation.DisplayName;
import com.frotty27.hrtk.api.annotation.Order;
import com.frotty27.hrtk.api.assert_.HytaleAssert;
import com.frotty27.hrtk.api.assert_.WeatherAssert;
import com.frotty27.hrtk.api.context.WorldTestContext;
import com.frotty27.hrtk.api.lifecycle.IsolationStrategy;
@HytaleSuite(value = "Weather Surface Tests", isolation = IsolationStrategy.DEDICATED_WORLD)
@Tag("weather")
public class WeatherSurfaceTests {
@WorldTest
@Order(1)
@DisplayName("Set weather to rain and verify it changed")
void setWeatherToRain(WorldTestContext ctx) {
// setWeather forces the world weather to the given type.
ctx.setWeather("rain");
ctx.waitTicks(1);
WeatherAssert.assertWeather(ctx.getWorld(), "rain");
WeatherAssert.assertNotWeather(ctx.getWorld(), "clear");
}
@WorldTest
@Order(2)
@DisplayName("Switch weather from rain to clear")
void switchWeatherToClear(WorldTestContext ctx) {
ctx.setWeather("rain");
ctx.waitTicks(1);
WeatherAssert.assertWeather(ctx.getWorld(), "rain");
// Switch to clear and verify.
ctx.setWeather("clear");
ctx.waitTicks(1);
WeatherAssert.assertWeather(ctx.getWorld(), "clear");
WeatherAssert.assertNotWeather(ctx.getWorld(), "rain");
}
@WorldTest
@Order(3)
@DisplayName("Set weather to snow and verify")
void setWeatherToSnow(WorldTestContext ctx) {
ctx.setWeather("snow");
ctx.waitTicks(1);
WeatherAssert.assertWeather(ctx.getWorld(), "snow");
}
}