|
|
@@ -3,11 +3,11 @@ |
|
|
|
using Gamecraft.Wires; |
|
|
|
using Unity.Mathematics; |
|
|
|
|
|
|
|
using GamecraftModdingAPI; |
|
|
|
using GamecraftModdingAPI.Tests; |
|
|
|
using GamecraftModdingAPI.Utility; |
|
|
|
using TechbloxModdingAPI; |
|
|
|
using TechbloxModdingAPI.Tests; |
|
|
|
using TechbloxModdingAPI.Utility; |
|
|
|
|
|
|
|
namespace GamecraftModdingAPI.Blocks |
|
|
|
namespace TechbloxModdingAPI.Blocks |
|
|
|
{ |
|
|
|
#if TEST |
|
|
|
/// <summary> |
|
|
@@ -31,7 +31,7 @@ namespace GamecraftModdingAPI.Blocks |
|
|
|
//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)] |
|
|
|
/*[APITestCase(TestType.EditMode)] |
|
|
|
public static void TestTextBlock() |
|
|
|
{ |
|
|
|
TextBlock textBlock = null; // Note: the assignment operation is a lambda, which slightly confuses the compiler |
|
|
@@ -74,7 +74,7 @@ namespace GamecraftModdingAPI.Blocks |
|
|
|
if (!Assert.CloseTo(b.MaximumAngle, 180f, $"Servo.MaximumAngle {b.MaximumAngle} does not equal default value, possibly because it failed silently.", "Servo.MaximumAngle is close enough to default.")) return; |
|
|
|
if (!Assert.CloseTo(b.MinimumAngle, -180f, $"Servo.MinimumAngle {b.MinimumAngle} does not equal default value, possibly because it failed silently.", "Servo.MinimumAngle is close enough to default.")) return; |
|
|
|
if (!Assert.CloseTo(b.MaximumForce, 60f, $"Servo.MaximumForce {b.MaximumForce} does not equal default value, possibly because it failed silently.", "Servo.MaximumForce is close enough to default.")) return; |
|
|
|
} |
|
|
|
}*/ |
|
|
|
|
|
|
|
[APITestCase(TestType.EditMode)] |
|
|
|
public static void TestDampedSpring() |
|
|
@@ -88,7 +88,7 @@ namespace GamecraftModdingAPI.Blocks |
|
|
|
if (!Assert.CloseTo(b.MaxExtension, 0.3f, $"DampedSpring.MaxExtension {b.MaxExtension} does not equal default value, possibly because it failed silently.", "DampedSpring.MaxExtension is close enough to default.")) return; |
|
|
|
} |
|
|
|
|
|
|
|
[APITestCase(TestType.Game)] |
|
|
|
/*[APITestCase(TestType.Game)] |
|
|
|
public static void TestMusicBlock1() |
|
|
|
{ |
|
|
|
Block newBlock = Block.PlaceNew(BlockIDs.MusicBlock, Unity.Mathematics.float3.zero + 2); |
|
|
@@ -131,14 +131,14 @@ namespace GamecraftModdingAPI.Blocks |
|
|
|
Wire newWire = null; |
|
|
|
if (!Assert.Errorless(() => { newWire = b.Connect(0, target, 0);})) return; |
|
|
|
if (!Assert.NotNull(newWire, "SignalingBlock.Connect(...) returned null, possible because it failed silently.", "SignalingBlock.Connect(...) returned a non-null value.")) return; |
|
|
|
} |
|
|
|
}*/ |
|
|
|
|
|
|
|
[APITestCase(TestType.EditMode)] |
|
|
|
/*[APITestCase(TestType.EditMode)] |
|
|
|
public static void TestSpecialiseError() |
|
|
|
{ |
|
|
|
Block newBlock = Block.PlaceNew(BlockIDs.Bench, new float3(1, 1, 1)); |
|
|
|
if (Assert.Errorful<BlockTypeException>(() => newBlock.Specialise<MusicBlock>(), "Block.Specialise<MusicBlock>() was expected to error on a bench block.", "Block.Specialise<MusicBlock>() errored as expected for a bench block.")) return; |
|
|
|
} |
|
|
|
}*/ |
|
|
|
} |
|
|
|
#endif |
|
|
|
} |