Skip to content

Commit

Permalink
Removed unused code from MultiplayerTests
Browse files Browse the repository at this point in the history
  • Loading branch information
hburn7 committed Feb 10, 2023
1 parent 7ca838e commit c33f3f7
Showing 1 changed file with 0 additions and 41 deletions.
41 changes: 0 additions & 41 deletions BanchoSharpTests/MultiplayerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,12 @@ namespace BanchoSharpTests;

public class MultiplayerTests
{
private const string _mpStart = "Started the match";
private const string _mpAbort = "Aborted the match";

// Events
private const string _matchStarted = "The match has started!";
private const string _matchFinished = "The match has finished!";
private IBanchoClient _client;
private IMultiplayerLobby _lobby;
// Commands
// private const string _mpSettings =
// "Room name: 3.00* - 5.00* | Auto Host Rotate, History: https://osu.ppy.sh/mp/104803682\nBeatmap: https://osu.ppy.sh/b/2216531 Sayuri - Koukai no Uta (TV Size)\nTeam mode: HeadToHead, Win condition: Score\nActive mods: Freemod\nPlayers: 7\nSlot 1 Not Ready https://osu.ppy.sh/u/22547049 Player 1 [Host]\nSlot 2 Not Ready https://osu.ppy.sh/u/14607058 Player 2 [Hidden, HardRock]\nSlot 3 Not Ready https://osu.ppy.sh/u/28851081 Player 3 \nSlot 4 Not Ready https://osu.ppy.sh/u/27831164 Player 4 \nSlot 6 Not Ready https://osu.ppy.sh/u/18028068 PlayerNameLarge1[Hidden, HardRock]\nSlot 7 Not Ready https://osu.ppy.sh/u/22940358 Player 6 \nSlot 8 Not Ready https://osu.ppy.sh/u/11796227 Player 7";

private string _mpSettings(string lobbyName, int lobbyId, string curBeatmapName, int curBeatmapId,
LobbyFormat curFormat, WinCondition winCondition, Mods activeMods) => new StringBuilder($"Room name: {lobbyName}, History: https://osu.ppy.sh/mp/{lobbyId}")
.AppendLine($"Beatmap: https://osu.ppy.sh/b/{curBeatmapId} {curBeatmapName}")
.AppendLine($"Team mode: {curFormat}, Win condition: {winCondition}")
.AppendLine($"Active mods: {activeMods.ToAbbreviatedForm()}")
.ToString();

private string _mpHost(string name) => $"Changed match host to {name}";
private string _mpMap(string id) => $"Changed beatmap to https://osu.ppy.sh/b/{id} EXAMPLE ARTIST - EXAMPLE TITLE";

private string _playerJoined(string name, int slot, string? team)
{
var builder = new StringBuilder($"{name} joined in slot {slot}");
Expand All @@ -47,26 +31,13 @@ private string _playerJoined(string name, int slot, string? team)
}

private string _slotChanged(string name, int slot) => $"{name} moved to slot {slot}";
private string _playerLeft(string name) => $"{name} left the game.";

private string _matchFinishedPlayerStats(string name, int score, bool passed) => new StringBuilder($"{name} finished playing (Score: {score}, ")
.Append(passed ? "PASSED" : "FAILED")
.Append(").")
.ToString();

private string _hostChanged(string name) => $"{name} became the host.";
private string _beatmapChanged(string title, string diff, int id) => $"Beatmap changed to: {title} [{diff}] (https://osu.ppy.sh/b/{id})";
private BanchoClient DefaultConfig() => new();
private IMultiplayerLobby DefaultLobby(IBanchoClient client) => new MultiplayerLobby(client, 1, "test");

private void InvokeEventInvoker(string message) => ((IBanchoBotEventInvoker)_client.BanchoBotEvents)
.ProcessMessage(PrivateIrcMessage.CreateFromParameters("BanchoBot", "DummyRecipient", message));

private void Invoke(IIrcMessage message) => _client.SimulateMessageReceived(message);

private void InvokeBancho(string banchoBotMessage, string recipient) => _client.SimulateMessageReceived(
PrivateIrcMessage.CreateFromParameters("BanchoBot", recipient, banchoBotMessage));

private void InvokeToLobby(string message) => Invoke(PrivateIrcMessage.CreateFromParameters("BanchoBot", _lobby.ChannelName, message));

[SetUp]
Expand All @@ -76,18 +47,6 @@ public void Setup()
_lobby = DefaultLobby(_client);
}

// [TestCase("Room name: test, History: https://osu.ppy.sh/mp/106275696",
// "Beatmap: https://osu.ppy.sh/b/3798824 fromis_9 - LOVE BOMB [Heart]",
// "Team mode: HeadToHead, Win condition: Score",
// "Active mods: DoubleTime",
// "Players: 1",
// "Slot 1 Not Ready https://osu.ppy.sh/u/8191845 Stage [Host]")]
// [TestCase("Room name: OWC 2021: (United States) vs. (Germany), History: https://osu.ppy.sh/mp/106275696",
// "Beatmap: https://osu.ppy.sh/b/3267589 Multiple Artists - thing [lol 235]",
// "Team mode: TagCoop, Win condition: Score",
// "Active mods: NoFail, Hidden, HardRock, Flashlight",
// "Players: 1",
// "Slot 1 Not Ready https://osu.ppy.sh/u/8191845 Stage [Host]")]
[TestCase("OWC 2021: (United States) vs. (Germany)", "https://osu.ppy.sh/mp/106275696", 106275696,
Mods.HalfTime | Mods.Freemod, 1096903, "Unmei no Dark Side -Rolling Gothic mix", "Kanpyohgo", "Satellite's Lunatic",
LobbyFormat.TagCoop, WinCondition.Score, TeamColor.None, true, PlayerState.NotReady,
Expand Down

0 comments on commit c33f3f7

Please sign in to comment.