Comment out Holo Test, needs one written by us
This commit is contained in:
parent
29addda0fe
commit
2628cd07dd
|
|
@ -23,43 +23,45 @@ public sealed class HolosignProjectorTest : MovementTest
|
|||
[Test]
|
||||
public async Task HoloSignTest()
|
||||
{
|
||||
var projector = await PlaceInHands(HoloSignProjectorProtoId);
|
||||
var projectorComp = Comp<HolosignProjectorComponent>(projector);
|
||||
var signProtoId = projectorComp.SignProto;
|
||||
|
||||
// No holosigns before using the item.
|
||||
await AssertEntityLookup((WallPrototype, 2));
|
||||
|
||||
var powerCellSystem = SEntMan.System<PowerCellSystem>();
|
||||
var initialUses = powerCellSystem.GetRemainingUses(ToServer(projector), projectorComp.ChargeUse);
|
||||
Assert.That(initialUses, Is.GreaterThan(0), "Holoprojector spawned without usable charges.");
|
||||
|
||||
// Click on the tile next to the player.
|
||||
await Interact(null, TargetCoords);
|
||||
|
||||
// We should have one charge less.
|
||||
var remainingUses = powerCellSystem.GetRemainingUses(ToServer(projector), projectorComp.ChargeUse);
|
||||
Assert.That(remainingUses, Is.EqualTo(initialUses - 1), "Holoprojector did not use the right amount of charge when used.");
|
||||
|
||||
// We should have spawned exactly one holosign.
|
||||
await AssertEntityLookup(
|
||||
(signProtoId, 1),
|
||||
(WallPrototype, 2));
|
||||
|
||||
// Try spawn more holosigns than we have charge.
|
||||
for (var i = 0; i < initialUses; i++)
|
||||
{
|
||||
await Interact(null, TargetCoords);
|
||||
}
|
||||
|
||||
// The total should be the same as the initial charges.
|
||||
await AssertEntityLookup(
|
||||
(signProtoId, initialUses),
|
||||
(WallPrototype, 2));
|
||||
|
||||
// We should have no charges left.
|
||||
remainingUses = powerCellSystem.GetRemainingUses(ToServer(projector), projectorComp.ChargeUse);
|
||||
Assert.That(remainingUses, Is.Zero, "Holoprojector did not use up all charges.");
|
||||
// Delta V - Our HoloProjector is differet. Using a different test for it soon.
|
||||
return;
|
||||
// var projector = await PlaceInHands(HoloSignProjectorProtoId);
|
||||
// var projectorComp = Comp<HolosignProjectorComponent>(projector);
|
||||
// var signProtoId = projectorComp.SignProto;
|
||||
//
|
||||
// // No holosigns before using the item.
|
||||
// await AssertEntityLookup((WallPrototype, 2));
|
||||
//
|
||||
// var powerCellSystem = SEntMan.System<PowerCellSystem>();
|
||||
// var initialUses = powerCellSystem.GetRemainingUses(ToServer(projector), projectorComp.ChargeUse);
|
||||
// Assert.That(initialUses, Is.GreaterThan(0), "Holoprojector spawned without usable charges.");
|
||||
//
|
||||
// // Click on the tile next to the player.
|
||||
// await Interact(null, TargetCoords);
|
||||
//
|
||||
// // We should have one charge less.
|
||||
// var remainingUses = powerCellSystem.GetRemainingUses(ToServer(projector), projectorComp.ChargeUse);
|
||||
// Assert.That(remainingUses, Is.EqualTo(initialUses - 1), "Holoprojector did not use the right amount of charge when used.");
|
||||
//
|
||||
// // We should have spawned exactly one holosign.
|
||||
// await AssertEntityLookup(
|
||||
// (signProtoId, 1),
|
||||
// (WallPrototype, 2));
|
||||
//
|
||||
// // Try spawn more holosigns than we have charge.
|
||||
// for (var i = 0; i < initialUses; i++)
|
||||
// {
|
||||
// await Interact(null, TargetCoords);
|
||||
// }
|
||||
//
|
||||
// // The total should be the same as the initial charges.
|
||||
// await AssertEntityLookup(
|
||||
// (signProtoId, initialUses),
|
||||
// (WallPrototype, 2));
|
||||
//
|
||||
// // We should have no charges left.
|
||||
// remainingUses = powerCellSystem.GetRemainingUses(ToServer(projector), projectorComp.ChargeUse);
|
||||
// Assert.That(remainingUses, Is.Zero, "Holoprojector did not use up all charges.");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -68,46 +70,47 @@ public sealed class HolosignProjectorTest : MovementTest
|
|||
[Test]
|
||||
public async Task HoloBarrierTest()
|
||||
{
|
||||
var projector = await PlaceInHands(HoloBarrierProjectorProtoId);
|
||||
var holoBarrierProtoId = Comp<HolosignProjectorComponent>(projector).SignProto;
|
||||
// No holobarriers before using the item.
|
||||
await AssertEntityLookup((WallPrototype, 2));
|
||||
|
||||
// Click on the tile next to the player.
|
||||
await Interact(null, TargetCoords);
|
||||
|
||||
// We should have spawned exactly one holobarrier.
|
||||
await AssertEntityLookup(
|
||||
(holoBarrierProtoId, 1),
|
||||
(WallPrototype, 2));
|
||||
Target = FromServer(await FindEntity(holoBarrierProtoId));
|
||||
var timeRemaining = Comp<TimedDespawnComponent>(Target).Lifetime;
|
||||
|
||||
// Check that the barrier is at the location we clicked at.
|
||||
AssertLocation(Target, TargetCoords);
|
||||
|
||||
// Try moving past the barrier.
|
||||
Assert.That(Delta(), Is.GreaterThan(0.5), "Player was not located west of the holobarrier.");
|
||||
await Move(DirectionFlag.East, 0.5f);
|
||||
Assert.That(Delta(), Is.GreaterThan(0.5), "Player was able to walk through a holobarrier.");
|
||||
|
||||
// Try to climb the barrier.
|
||||
await Interact(Target, TargetCoords, altInteract: true);
|
||||
|
||||
// We should be able to move past the barrier now.
|
||||
await Move(DirectionFlag.East, 0.5f);
|
||||
Assert.That(Delta(), Is.LessThan(-0.5), "Player was not able to climb over a holobarrier.");
|
||||
|
||||
// We should not be able to walk back without climbing again.
|
||||
await Move(DirectionFlag.West, 0.5f);
|
||||
Assert.That(Delta(), Is.LessThan(-0.5), "Player was able to walk through a holobarrier.");
|
||||
|
||||
// Wait until the barrier despawns.
|
||||
await RunSeconds(timeRemaining);
|
||||
AssertDeleted(Target);
|
||||
|
||||
// We should be able to walk back now.
|
||||
await Move(DirectionFlag.West, 0.5f);
|
||||
Assert.That(DeltaCoordinates(), Is.GreaterThan(0.5), "Player was able to walk past a deleted holobarrier.");
|
||||
return; // Delta V - Barrier works a bit different
|
||||
// var projector = await PlaceInHands(HoloBarrierProjectorProtoId);
|
||||
// var holoBarrierProtoId = Comp<HolosignProjectorComponent>(projector).SignProto;
|
||||
// // No holobarriers before using the item.
|
||||
// await AssertEntityLookup((WallPrototype, 2));
|
||||
//
|
||||
// // Click on the tile next to the player.
|
||||
// await Interact(null, TargetCoords);
|
||||
//
|
||||
// // We should have spawned exactly one holobarrier.
|
||||
// await AssertEntityLookup(
|
||||
// (holoBarrierProtoId, 1),
|
||||
// (WallPrototype, 2));
|
||||
// Target = FromServer(await FindEntity(holoBarrierProtoId));
|
||||
// var timeRemaining = Comp<TimedDespawnComponent>(Target).Lifetime;
|
||||
//
|
||||
// // Check that the barrier is at the location we clicked at.
|
||||
// AssertLocation(Target, TargetCoords);
|
||||
//
|
||||
// // Try moving past the barrier.
|
||||
// Assert.That(Delta(), Is.GreaterThan(0.5), "Player was not located west of the holobarrier.");
|
||||
// await Move(DirectionFlag.East, 0.5f);
|
||||
// Assert.That(Delta(), Is.GreaterThan(0.5), "Player was able to walk through a holobarrier.");
|
||||
//
|
||||
// // Try to climb the barrier.
|
||||
// await Interact(Target, TargetCoords, altInteract: true);
|
||||
//
|
||||
// // We should be able to move past the barrier now.
|
||||
// await Move(DirectionFlag.East, 0.5f);
|
||||
// Assert.That(Delta(), Is.LessThan(-0.5), "Player was not able to climb over a holobarrier.");
|
||||
//
|
||||
// // We should not be able to walk back without climbing again.
|
||||
// await Move(DirectionFlag.West, 0.5f);
|
||||
// Assert.That(Delta(), Is.LessThan(-0.5), "Player was able to walk through a holobarrier.");
|
||||
//
|
||||
// // Wait until the barrier despawns.
|
||||
// await RunSeconds(timeRemaining);
|
||||
// AssertDeleted(Target);
|
||||
//
|
||||
// // We should be able to walk back now.
|
||||
// await Move(DirectionFlag.West, 0.5f);
|
||||
// Assert.That(DeltaCoordinates(), Is.GreaterThan(0.5), "Player was able to walk past a deleted holobarrier.");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue