|
|
@@ -20,11 +20,11 @@ namespace GamecraftModdingAPI.Blocks |
|
|
|
} |
|
|
|
|
|
|
|
[APITestCase(TestType.EditMode)] |
|
|
|
public static void TestSync() |
|
|
|
public static void TestInitProperty() |
|
|
|
{ |
|
|
|
Block newBlock = Block.PlaceNew(BlockIDs.AluminiumCube, Unity.Mathematics.float3.zero + 2); |
|
|
|
if (!Assert.CloseTo(newBlock.Position, (Unity.Mathematics.float3.zero + 2), $"Newly placed block at {newBlock.Position} is expected at {Unity.Mathematics.float3.zero + 2}.", "Newly placed block position matches.")) return; |
|
|
|
Assert.Equal(newBlock.Exists, true, "Newly placed block does not exist, possibly because Sync() skipped/missed/failed.", "Newly placed block exists, Sync() successful."); |
|
|
|
//Assert.Equal(newBlock.Exists, true, "Newly placed block does not exist, possibly because Sync() skipped/missed/failed.", "Newly placed block exists, Sync() successful."); |
|
|
|
} |
|
|
|
|
|
|
|
[APITestCase(TestType.EditMode)] |
|
|
@@ -32,7 +32,7 @@ namespace GamecraftModdingAPI.Blocks |
|
|
|
{ |
|
|
|
TextBlock textBlock = null; // Note: the assignment operation is a lambda, which slightly confuses the compiler |
|
|
|
Assert.Errorless(() => { textBlock = Block.PlaceNew<TextBlock>(BlockIDs.TextBlock, Unity.Mathematics.float3.zero + 1); }, "Block.PlaceNew<TextBlock>() raised an exception: ", "Block.PlaceNew<TextBlock>() completed without issue."); |
|
|
|
if (!Assert.NotNull(textBlock, "Block.Specialize<TextBlock>() returned null, possibly because it failed silently.", "Specialized TextBlock is not null.")) return; |
|
|
|
if (!Assert.NotNull(textBlock, "Block.PlaceNew<TextBlock>() returned null, possibly because it failed silently.", "Specialized TextBlock is not null.")) return; |
|
|
|
if (!Assert.NotNull(textBlock.Text, "TextBlock.Text is null, possibly because it failed silently.", "TextBlock.Text is not null.")) return; |
|
|
|
if (!Assert.NotNull(textBlock.TextBlockId, "TextBlock.TextBlockId is null, possibly because it failed silently.", "TextBlock.TextBlockId is not null.")) return; |
|
|
|
} |
|
|
|