Skip to content

Commit

Permalink
chore: synced unity from 'fix: string operaitons being swapped
Browse files Browse the repository at this point in the history
How did I even miss this'
  • Loading branch information
github-bot committed May 24, 2024
1 parent d6f0988 commit 26d8a6f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -778,9 +778,9 @@ internal static string GetStringOperation(StringOperation operation)
switch (operation)
{
case StringOperation.Append:
return "prepend";
case StringOperation.Prepend:
return "append";
case StringOperation.Prepend:
return "prepend";
default:
throw new ArgumentOutOfRangeException(nameof(operation), operation, null);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,23 @@ public async Task UpdateInt_InvalidOperation_Throws()

Assert.That(caught, Is.True);
}

[Test]
public void GetStringOperationString()
{
Assert.That(GameJoltDataStore.GetStringOperation(StringOperation.Append), Is.EqualTo("append"));
Assert.That(GameJoltDataStore.GetStringOperation(StringOperation.Prepend), Is.EqualTo("prepend"));
}

[Test]
public void GetNumberOperation()
{
Assert.That(GameJoltDataStore.GetNumberOperation(NumericOperation.Add), Is.EqualTo("add"));
Assert.That(GameJoltDataStore.GetNumberOperation(NumericOperation.Subtract), Is.EqualTo("subtract"));
Assert.That(GameJoltDataStore.GetNumberOperation(NumericOperation.Multiply), Is.EqualTo("multiply"));
Assert.That(GameJoltDataStore.GetNumberOperation(NumericOperation.Divide), Is.EqualTo("divide"));
Assert.That(GameJoltDataStore.GetNumberOperation(NumericOperation.Append), Is.EqualTo("append"));
Assert.That(GameJoltDataStore.GetNumberOperation(NumericOperation.Prepend), Is.EqualTo("prepend"));
}
}
}

0 comments on commit 26d8a6f

Please sign in to comment.