1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-06 02:37:25 +08:00
osu-lazer/osu.Game.Tests/Scores/IO/TestScoreEquality.cs
Dean Herbert 5f6e887be7 Remove OnlineID comparison from ScoreInfo.Equals
This matches the implementation we have for `BeatmapInfo` and
`BeatmapSetInfo`. All comparisons of `OnlineID` should be done directly
using them (ie. how it's done in `ScoreModelDownloader`).
2021-12-10 18:17:43 +09:00

56 lines
1.4 KiB
C#

// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using NUnit.Framework;
using osu.Game.Scoring;
namespace osu.Game.Tests.Scores.IO
{
[TestFixture]
public class TestScoreEquality
{
[Test]
public void TestNonMatchingByReference()
{
ScoreInfo score1 = new ScoreInfo();
ScoreInfo score2 = new ScoreInfo();
Assert.That(score1, Is.Not.EqualTo(score2));
}
[Test]
public void TestMatchingByReference()
{
ScoreInfo score = new ScoreInfo();
Assert.That(score, Is.EqualTo(score));
}
[Test]
public void TestNonMatchingByPrimaryKey()
{
ScoreInfo score1 = new ScoreInfo { ID = 1 };
ScoreInfo score2 = new ScoreInfo { ID = 2 };
Assert.That(score1, Is.Not.EqualTo(score2));
}
[Test]
public void TestMatchingByPrimaryKey()
{
ScoreInfo score1 = new ScoreInfo { ID = 1 };
ScoreInfo score2 = new ScoreInfo { ID = 1 };
Assert.That(score1, Is.EqualTo(score2));
}
[Test]
public void TestNonMatchingByNull()
{
ScoreInfo score = new ScoreInfo();
Assert.That(score, Is.Not.EqualTo(null));
}
}
}