- Related to https://github.com/ppy/osu/issues/37818
Works around issue described in https://github.com/ppy/osu/pull/38013.
Saying it "fixes" it seems like a stretch.
A real fix would again be using `decimal` everywhere, probably, but I'm
not really sure I want to be doing that, as `decimal`s are annoying to
deal with and slow, and floating-point is already doing well enough in
the actual usage context of total scores (I did not find one case of
inaccuracy over multiple days of cross-checks).
Fixes a bug that allowed for selecting the same mod twice in multiplayer
if the playlist entry has non-default settings for a required mod.
This happens due to a strict equality mod check in the mod set
compatibility check function, which only considers mods duplicates if
their settings are exactly the same. Replacing with a more lenient
`Type` check fixes this.
Adds a regression test for this behavior
Fixes https://github.com/ppy/osu/issues/37625.
---------
Co-authored-by: Bartłomiej Dach <dach.bartlomiej@gmail.com>
It's been a while.
Notes:
- `SharpCompress` usages changed a bit. Manually adjusted these, mostly
just renames or adjusted parameters.
- nUnit 3 -> 4 migrated using
https://gist.github.com/peppy/07994386d793a117350cb5f24b156585. there's
a mode in this script to update to the newer `Assert.That` syntax but it
requires fixes and couldn't really be bothered.
- DeepEqual nuked as the only usage was on a disabled test. The reason
it's disabled has been merged upstream, but it's failing for other
(realm) reasons which I don't think is worthwhile to investigate for
now.
- This bumps Moq. I think the author is back in a sensible headspace and
the new version has the stupid shit removed, so probably okay? Nice to
be on a level playing field with packages for once in a long time.
- Automapper is silly, but we've discussed this elsewhere.
- `TestRealmKeyBindingStore` failures are a wildcard, but fixed by using
a more standardised testing method. Dunno why, don't care.
---------
Co-authored-by: Bartłomiej Dach <dach.bartlomiej@gmail.com>
As it turns out, C# 8 provides an attribute that allows annotating that
an `out` parameter's nullability depends on the method's return value,
which is exactly what is desired here.
For safety purposes... In implementing the previous tests, I found that
using mod.Object.GetType() can lead to bad assertions since the same
ModProxy class is used for all mocked classes.