mirror of
https://github.com/osukey/osukey.git
synced 2025-07-03 01:09:57 +09:00
Don't serialise empty mod settings
This commit is contained in:
@ -6,6 +6,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using NUnit.Framework;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Game.Beatmaps;
|
||||
@ -148,6 +149,16 @@ namespace osu.Game.Tests.Online
|
||||
Assert.That(apiMod.Settings["speed_change"], Is.EqualTo(1.01d));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestSerialisedModSettingPresence()
|
||||
{
|
||||
var mod = new TestMod();
|
||||
|
||||
mod.TestSetting.Value = mod.TestSetting.Default;
|
||||
JObject serialised = JObject.Parse(JsonConvert.SerializeObject(new APIMod(mod)));
|
||||
Assert.False(serialised.ContainsKey("settings"));
|
||||
}
|
||||
|
||||
private class TestRuleset : Ruleset
|
||||
{
|
||||
public override IEnumerable<Mod> GetModsFor(ModType type) => new Mod[]
|
||||
|
Reference in New Issue
Block a user