public void TestReturnNullOnFallbackFailure() { var textureStore = new TestTextureStore("sliderb", "hit100"); var legacySkin = new TestLegacySkin(textureStore); var texture = legacySkin.GetTexture("Gameplay/osu/followpoint"); Assert.IsNull(texture); }
private (IBeatmap beatmap, TestLegacySkin beatmapSkin) decodeFromLegacy(Stream stream, string name) { using (var reader = new LineBufferedReader(stream)) { var beatmap = new LegacyBeatmapDecoder { ApplyOffsets = false }.Decode(reader); var beatmapSkin = new TestLegacySkin(beatmaps_resource_store, name); return(convert(beatmap), beatmapSkin); } }
public void TestFallbackOrder(string[] filesInStore, string requestedComponent, string expectedTexture, float expectedScale) { var textureStore = new TestTextureStore(filesInStore); var legacySkin = new TestLegacySkin(textureStore); var texture = legacySkin.GetTexture(requestedComponent); Assert.IsNotNull(texture); Assert.AreEqual(textureStore.Textures[expectedTexture], texture); Assert.AreEqual(expectedScale, texture.ScaleAdjust); }
public void TestCatchSkinColourDecoding() { var store = new NamespacedResourceStore <byte[]>(new DllResourceStore(GetType().Assembly), "Resources/special-skin"); var rawSkin = new TestLegacySkin(new SkinInfo { Name = "special-skin" }, store); var skin = new CatchLegacySkinTransformer(rawSkin); Assert.AreEqual(new Color4(232, 185, 35, 255), skin.GetConfig <CatchSkinColour, Color4>(CatchSkinColour.HyperDash)?.Value); Assert.AreEqual(new Color4(232, 74, 35, 255), skin.GetConfig <CatchSkinColour, Color4>(CatchSkinColour.HyperDashAfterImage)?.Value); Assert.AreEqual(new Color4(0, 255, 255, 255), skin.GetConfig <CatchSkinColour, Color4>(CatchSkinColour.HyperDashFruit)?.Value); }