Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/Wisp.App.Tests/ElectricNativeRoutingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public void TireTemperatureGaugesShareTheNativeRootAndRemainAvailableForElectric
Assert.Same(root, analogue.Parent);
Assert.Equal("{Binding TireTemperatureDisplay}", digital.Attribute("Display")?.Value);
Assert.Equal("{Binding TireTemperatureDisplay}", analogue.Attribute("Display")?.Value);
Assert.Equal("{Binding NativeGaugeFrame.IsElectric}", analogue.Attribute("IsElectricMaterial")?.Value);
Assert.Equal("{Binding IsElectricPowertrain}", analogue.Attribute("IsElectricMaterial")?.Value);
Assert.DoesNotContain("IsElectric", digital.ToString(), StringComparison.Ordinal);
}

Expand Down
17 changes: 9 additions & 8 deletions tests/Wisp.App.Tests/SupplementaryOperationFailureTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,20 +60,21 @@ public async Task SetupBindingRetainsTheRealSocketErrorWithoutUserData(int code,
}

[Theory]
[InlineData(0, 0, "no-datagrams")]
[InlineData(0, 4, "packets-rejected")]
[InlineData(5, 1, "sequence-incomplete")]
public async Task SetupTimeoutReportsWhatTheReceiverActuallyObserved(long accepted, long rejected, string reason)
[InlineData(0, 0)]
[InlineData(0, 4)]
[InlineData(5, 1)]
public async Task CancellingAfterTheGuidanceCheckpointRecordsNoTimeout(long accepted, long rejected)
{
using var observations = new ObservationScope();
var source = new Source(null, new(AcceptedPackets: accepted, RejectedPackets: rejected, PacketsPerSecond: 0, LastParseError: PacketParseError.None, ListenerError: null));
// The test keeps listening after its first timeout; cancelling ends it once that timeout has been observed.
// The test keeps listening past its guidance checkpoint; a player who cancels afterwards has not failed the test,
// whatever the receiver had seen, so no timeout outcome or incident is recorded.
using var cancellation = new CancellationTokenSource(TimeSpan.FromMilliseconds(500));
var result = await new SetupTelemetryTest(source, timeout: TimeSpan.FromMilliseconds(20)).RunAsync("5500", cancellationToken: cancellation.Token);
Assert.False(result.Passed);
var terminal = Assert.Single(observations.Values, v => v.Outcome == "timeout");
Assert.Equal(reason, terminal.Incident?.Reason);
Assert.True(SupplementaryIncidentSchema.Valid(terminal.Incident!));
Assert.DoesNotContain(observations.Values, v => v.Outcome == "timeout");
Assert.Contains(observations.Values, v => v.Outcome == "cancelled");
Assert.All(observations.Values, v => Assert.Null(v.Incident));
Assert.False(source.IsRunning);
}

Expand Down
Loading