From d17bdddd3c195e912cd761c5d4782d278c454aad Mon Sep 17 00:00:00 2001 From: andy840119 Date: Tue, 10 Dec 2024 21:45:26 +0800 Subject: [PATCH] chore(test): P3.1 - Remove unnecessary test case. --- .../KaraokeSkinElementConverterTest.cs | 26 ++----------------- .../Skin/TestSceneKaraokeSkinEditor.cs | 1 - .../KaraokeBeatmapSkinDecodingTest.cs | 3 --- .../Skinning/KaraokeSkinDecodingTest.cs | 3 --- 4 files changed, 2 insertions(+), 31 deletions(-) diff --git a/osu.Game.Rulesets.Karaoke.Tests/IO/Serialization/Converters/KaraokeSkinElementConverterTest.cs b/osu.Game.Rulesets.Karaoke.Tests/IO/Serialization/Converters/KaraokeSkinElementConverterTest.cs index dc93a93c3..edec61ef6 100644 --- a/osu.Game.Rulesets.Karaoke.Tests/IO/Serialization/Converters/KaraokeSkinElementConverterTest.cs +++ b/osu.Game.Rulesets.Karaoke.Tests/IO/Serialization/Converters/KaraokeSkinElementConverterTest.cs @@ -43,34 +43,12 @@ public void TestLyricConfigDeserialize() ObjectAssert.ArePropertyEqual(expected, actual); } - [Test] - public void TestLyricStyleSerializer() - { - var lyricStyle = LyricStyle.CreateDefault(); - - const string expected = - "{\"$type\":1,\"left_lyric_text_shaders\":[{\"$type\":\"StepShader\",\"name\":\"Step shader\",\"draw\":true,\"step_shaders\":[{\"$type\":\"OutlineShader\",\"outline_colour\":\"#CCA532\",\"radius\":3.0},{\"$type\":\"ShadowShader\",\"shadow_colour\":\"#6B5B2D\",\"shadow_offset\":{\"x\":3.0,\"y\":3.0}}]}],\"right_lyric_text_shaders\":[{\"$type\":\"StepShader\",\"name\":\"Step shader\",\"draw\":true,\"step_shaders\":[{\"$type\":\"OutlineShader\",\"outline_colour\":\"#5932CC\",\"radius\":3.0},{\"$type\":\"ShadowShader\",\"shadow_colour\":\"#3D2D6B\",\"shadow_offset\":{\"x\":3.0,\"y\":3.0}}]}],\"name\":\"Default\"}"; - string actual = JsonConvert.SerializeObject(lyricStyle, CreateSettings()); - Assert.AreEqual(expected, actual); - } - - [Test] - public void TestLyricStyleDeserializer() - { - const string json = - "{\"$type\":1,\"left_lyric_text_shaders\":[{\"$type\":\"StepShader\",\"name\":\"Step shader\",\"draw\":true,\"step_shaders\":[{\"$type\":\"OutlineShader\",\"outline_colour\":\"#CCA532\",\"radius\":3.0},{\"$type\":\"ShadowShader\",\"shadow_colour\":\"#6B5B2D\",\"shadow_offset\":{\"x\":3.0,\"y\":3.0}}]}],\"right_lyric_text_shaders\":[{\"$type\":\"StepShader\",\"name\":\"Step shader\",\"draw\":true,\"step_shaders\":[{\"$type\":\"OutlineShader\",\"outline_colour\":\"#5932CC\",\"radius\":3.0},{\"$type\":\"ShadowShader\",\"shadow_colour\":\"#3D2D6B\",\"shadow_offset\":{\"x\":3.0,\"y\":3.0}}]}],\"name\":\"Default\"}"; - - var expected = LyricStyle.CreateDefault(); - var actual = (LyricStyle)JsonConvert.DeserializeObject(json, CreateSettings())!; - ObjectAssert.ArePropertyEqual(expected, actual); - } - [Test] public void TestNoteStyleSerializer() { var lyricConfig = NoteStyle.CreateDefault(); - const string expected = "{\"$type\":2,\"name\":\"Default\",\"note_color\":\"#44AADD\",\"blink_color\":\"#FF66AA\",\"text_color\":\"#FFFFFF\",\"bold_text\":true}"; + const string expected = "{\"$type\":1,\"name\":\"Default\",\"note_color\":\"#44AADD\",\"blink_color\":\"#FF66AA\",\"text_color\":\"#FFFFFF\",\"bold_text\":true}"; string actual = JsonConvert.SerializeObject(lyricConfig, CreateSettings()); Assert.AreEqual(expected, actual); } @@ -78,7 +56,7 @@ public void TestNoteStyleSerializer() [Test] public void TestNoteStyleDeserializer() { - const string json = "{\"$type\":2,\"name\":\"Default\",\"note_color\":\"#44AADD\",\"blink_color\":\"#FF66AA\",\"text_color\":\"#FFFFFF\",\"bold_text\":true}"; + const string json = "{\"$type\":1,\"name\":\"Default\",\"note_color\":\"#44AADD\",\"blink_color\":\"#FF66AA\",\"text_color\":\"#FFFFFF\",\"bold_text\":true}"; var expected = NoteStyle.CreateDefault(); var actual = (NoteStyle)JsonConvert.DeserializeObject(json, CreateSettings())!; diff --git a/osu.Game.Rulesets.Karaoke.Tests/Screens/Skin/TestSceneKaraokeSkinEditor.cs b/osu.Game.Rulesets.Karaoke.Tests/Screens/Skin/TestSceneKaraokeSkinEditor.cs index 872a6d571..c8d78472a 100644 --- a/osu.Game.Rulesets.Karaoke.Tests/Screens/Skin/TestSceneKaraokeSkinEditor.cs +++ b/osu.Game.Rulesets.Karaoke.Tests/Screens/Skin/TestSceneKaraokeSkinEditor.cs @@ -67,7 +67,6 @@ public TestingSkin(SkinInfo skin, IStorageResourceProvider? resources) : base(skin, resources) { DefaultElement[ElementType.LyricFontInfo] = LyricFontInfo.CreateDefault(); - DefaultElement[ElementType.LyricStyle] = LyricStyle.CreateDefault(); DefaultElement[ElementType.NoteStyle] = NoteStyle.CreateDefault(); } } diff --git a/osu.Game.Rulesets.Karaoke.Tests/Skinning/KaraokeBeatmapSkinDecodingTest.cs b/osu.Game.Rulesets.Karaoke.Tests/Skinning/KaraokeBeatmapSkinDecodingTest.cs index 24347d1ec..00dc8d91f 100644 --- a/osu.Game.Rulesets.Karaoke.Tests/Skinning/KaraokeBeatmapSkinDecodingTest.cs +++ b/osu.Game.Rulesets.Karaoke.Tests/Skinning/KaraokeBeatmapSkinDecodingTest.cs @@ -27,17 +27,14 @@ public void TestKaraokeBeatmapSkinDefaultValue() // try to get default value from the skin. var defaultLyricFontInfo = skin.GetConfig(referencedLyric)!.Value; - var defaultLyricStyle = skin.GetConfig(referencedLyric)!.Value; var defaultNoteStyle = skin.GetConfig(testingNote)!.Value; // should be able to get the default value. Assert.IsNotNull(defaultLyricFontInfo); - Assert.IsNotNull(defaultLyricStyle); Assert.IsNotNull(defaultNoteStyle); // Check the content Assert.IsNotNull(defaultLyricFontInfo.Name, "Default lyric config"); - Assert.IsNotNull(defaultLyricStyle.Name, "Default lyric style"); Assert.IsNotNull(defaultNoteStyle.Name, "Default note style"); } } diff --git a/osu.Game.Rulesets.Karaoke.Tests/Skinning/KaraokeSkinDecodingTest.cs b/osu.Game.Rulesets.Karaoke.Tests/Skinning/KaraokeSkinDecodingTest.cs index af5a8943c..839ac10af 100644 --- a/osu.Game.Rulesets.Karaoke.Tests/Skinning/KaraokeSkinDecodingTest.cs +++ b/osu.Game.Rulesets.Karaoke.Tests/Skinning/KaraokeSkinDecodingTest.cs @@ -27,17 +27,14 @@ public void TestKaraokeSkinDefaultValue() // try to get default value from the skin. var defaultLyricFontInfo = skin.GetConfig(referencedLyric)!.Value; - var defaultLyricStyle = skin.GetConfig(referencedLyric)!.Value; var defaultNoteStyle = skin.GetConfig(testingNote)!.Value; // should be able to get the default value. Assert.IsNotNull(defaultLyricFontInfo); - Assert.IsNotNull(defaultLyricStyle); Assert.IsNotNull(defaultNoteStyle); // Check the content Assert.IsNotNull(defaultLyricFontInfo.Name, "Default lyric config"); - Assert.IsNotNull(defaultLyricStyle.Name, "Default lyric style"); Assert.IsNotNull(defaultNoteStyle.Name, "Default note style"); } }