Skip to content
Merged
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
6 changes: 3 additions & 3 deletions src/GameEngineAdapter.Headless/HeadlessAudioPlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ public sealed class HeadlessAudioPlayer : IAudioPlayer

/// <inheritdoc />
public void StartPlayback(string audioAssetId, bool loopPlayback = false) =>
_recordedCalls.Add(("Play", audioAssetId, loopPlayback));
_recordedCalls.Add((nameof(StartPlayback), audioAssetId, loopPlayback));

/// <inheritdoc />
public void StopPlayback(string audioAssetId) =>
_recordedCalls.Add(("Stop", audioAssetId, null));
_recordedCalls.Add((nameof(StopPlayback), audioAssetId, null));

/// <inheritdoc />
public void SetVolume(string audioAssetId, float volume) =>
_recordedCalls.Add(("SetVolume", audioAssetId, volume));
_recordedCalls.Add((nameof(SetVolume), audioAssetId, volume));

/// <summary>Clears all recorded calls.</summary>
public void Clear() => _recordedCalls.Clear();
Expand Down
12 changes: 6 additions & 6 deletions src/GameEngineAdapter.UnitTests/HeadlessAudioPlayerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public void HeadlessAudioPlayer_Play_RecordsCall()
// Assert
Assert.Single(player.RecordedCalls);
var call = player.RecordedCalls[0];
Assert.Equal("Play", call.Method);
Assert.Equal(nameof(player.StartPlayback), call.Method);
Assert.Equal("music_main", call.AudioAssetId);
Assert.Equal(true, call.Arg);
}
Expand Down Expand Up @@ -57,7 +57,7 @@ public void HeadlessAudioPlayer_Stop_RecordsCall()
// Assert
Assert.Single(player.RecordedCalls);
var call = player.RecordedCalls[0];
Assert.Equal("Stop", call.Method);
Assert.Equal(nameof(player.StopPlayback), call.Method);
Assert.Equal("music_main", call.AudioAssetId);
Assert.Null(call.Arg);
}
Expand All @@ -74,7 +74,7 @@ public void HeadlessAudioPlayer_SetVolume_RecordsCall()
// Assert
Assert.Single(player.RecordedCalls);
var call = player.RecordedCalls[0];
Assert.Equal("SetVolume", call.Method);
Assert.Equal(nameof(player.SetVolume), call.Method);
Assert.Equal("music_main", call.AudioAssetId);
Assert.Equal(0.5f, call.Arg);
}
Expand All @@ -92,9 +92,9 @@ public void HeadlessAudioPlayer_MultipleOperations_RecordsAllInOrder()

// Assert
Assert.Equal(3, player.RecordedCalls.Count);
Assert.Equal("Play", player.RecordedCalls[0].Method);
Assert.Equal("SetVolume", player.RecordedCalls[1].Method);
Assert.Equal("Stop", player.RecordedCalls[2].Method);
Assert.Equal(nameof(player.StartPlayback), player.RecordedCalls[0].Method);
Assert.Equal(nameof(player.SetVolume), player.RecordedCalls[1].Method);
Assert.Equal(nameof(player.StopPlayback), player.RecordedCalls[2].Method);
}

[Fact]
Expand Down
Loading