Class CodecTests<T>
java.lang.Object
net.darkhax.bookshelf.impl.gametest.tests.CodecTests<T>
- All Implemented Interfaces:
ITestable
- Direct Known Subclasses:
RegistryCodecTests
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final CodecHelper<T>protected final T[]protected final BiPredicate<T,T> protected final Tprotected final String -
Constructor Summary
ConstructorsConstructorDescriptionCodecTests(String type, CodecHelper<T> codecHelper, BiPredicate<T, T> equality, T... collection) CodecTests(String type, CodecHelper<T> codecHelper, BiPredicate<T, T> equality, T singleton, T... collection) CodecTests(String type, CodecHelper<T> serializer, T... collection) -
Method Summary
Modifier and TypeMethodDescriptionstatic <DT> DTfromJson(net.minecraft.gametest.framework.GameTestHelper helper, com.mojang.serialization.Codec<DT> codec, com.google.gson.JsonElement json) static <DT> DTfromJson(net.minecraft.gametest.framework.GameTestHelper helper, com.mojang.serialization.MapCodec<DT> codec, com.google.gson.JsonElement data) Gets a default batch name that will supersede the annotation default when not null.voidtest_array(net.minecraft.gametest.framework.GameTestHelper helper) voidtest_list(net.minecraft.gametest.framework.GameTestHelper helper) voidtest_list_empty(net.minecraft.gametest.framework.GameTestHelper helper) voidtest_list_singleton(net.minecraft.gametest.framework.GameTestHelper helper) voidtest_nullable(net.minecraft.gametest.framework.GameTestHelper helper) voidtest_nullable_null(net.minecraft.gametest.framework.GameTestHelper helper) voidtest_optional(net.minecraft.gametest.framework.GameTestHelper helper) voidtest_optional_empty(net.minecraft.gametest.framework.GameTestHelper helper) voidtest_set(net.minecraft.gametest.framework.GameTestHelper helper) voidtest_singleton(net.minecraft.gametest.framework.GameTestHelper helper) voidtest_weighted(net.minecraft.gametest.framework.GameTestHelper helper) voidtest_weighted_list(net.minecraft.gametest.framework.GameTestHelper helper) static <DT> com.google.gson.JsonElementtoJson(net.minecraft.gametest.framework.GameTestHelper helper, com.mojang.serialization.Codec<DT> codec, DT data) static <DT> com.google.gson.JsonElementtoJson(net.minecraft.gametest.framework.GameTestHelper helper, com.mojang.serialization.MapCodec<DT> codec, DT data)
-
Field Details
-
type
-
codecHelper
-
singleton
-
collection
-
equality
-
-
Constructor Details
-
CodecTests
-
CodecTests
public CodecTests(String type, CodecHelper<T> codecHelper, BiPredicate<T, T> equality, T... collection) -
CodecTests
public CodecTests(String type, CodecHelper<T> codecHelper, BiPredicate<T, T> equality, T singleton, T... collection)
-
-
Method Details
-
test_singleton
public void test_singleton(net.minecraft.gametest.framework.GameTestHelper helper) -
test_array
public void test_array(net.minecraft.gametest.framework.GameTestHelper helper) -
test_list
public void test_list(net.minecraft.gametest.framework.GameTestHelper helper) -
test_list_singleton
public void test_list_singleton(net.minecraft.gametest.framework.GameTestHelper helper) -
test_list_empty
public void test_list_empty(net.minecraft.gametest.framework.GameTestHelper helper) -
test_set
public void test_set(net.minecraft.gametest.framework.GameTestHelper helper) -
test_optional
public void test_optional(net.minecraft.gametest.framework.GameTestHelper helper) -
test_optional_empty
public void test_optional_empty(net.minecraft.gametest.framework.GameTestHelper helper) -
test_nullable
public void test_nullable(net.minecraft.gametest.framework.GameTestHelper helper) -
test_nullable_null
public void test_nullable_null(net.minecraft.gametest.framework.GameTestHelper helper) -
test_weighted
public void test_weighted(net.minecraft.gametest.framework.GameTestHelper helper) -
test_weighted_list
public void test_weighted_list(net.minecraft.gametest.framework.GameTestHelper helper) -
getDefaultBatch
Description copied from interface:ITestableGets a default batch name that will supersede the annotation default when not null.- Specified by:
getDefaultBatchin interfaceITestable- Returns:
- The default batch name for all tests in the implementation.
-
toJson
public static <DT> com.google.gson.JsonElement toJson(net.minecraft.gametest.framework.GameTestHelper helper, com.mojang.serialization.MapCodec<DT> codec, DT data) -
fromJson
public static <DT> DT fromJson(net.minecraft.gametest.framework.GameTestHelper helper, com.mojang.serialization.MapCodec<DT> codec, com.google.gson.JsonElement data) -
toJson
public static <DT> com.google.gson.JsonElement toJson(net.minecraft.gametest.framework.GameTestHelper helper, com.mojang.serialization.Codec<DT> codec, DT data) -
fromJson
public static <DT> DT fromJson(net.minecraft.gametest.framework.GameTestHelper helper, com.mojang.serialization.Codec<DT> codec, com.google.gson.JsonElement json)
-