mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 15:44:04 +09:00
Start implementing legacy decoder
This commit is contained in:
committed by
Dean Herbert
parent
c9a057b510
commit
2a3f047895
46
osu.Game.Tests/Beatmaps/IO/OszArchiveReaderTest.cs
Normal file
46
osu.Game.Tests/Beatmaps/IO/OszArchiveReaderTest.cs
Normal file
@ -0,0 +1,46 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using NUnit.Framework;
|
||||
using osu.Game.Beatmaps.IO;
|
||||
using osu.Game.Tests.Resources;
|
||||
|
||||
namespace osu.Game.Tests.Beatmaps.IO
|
||||
{
|
||||
[TestFixture]
|
||||
public class OszArchiveReaderTest
|
||||
{
|
||||
[TestFixtureSetUp]
|
||||
public void SetUp()
|
||||
{
|
||||
OszArchiveReader.Register();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestReadBeatmaps()
|
||||
{
|
||||
using (var osz = File.OpenRead(Resource.GetPath("241526 Soleily - Renatus.osz")))
|
||||
{
|
||||
var reader = new OszArchiveReader(osz);
|
||||
string[] expected =
|
||||
{
|
||||
"Soleily - Renatus (Deif) [Platter].osu",
|
||||
"Soleily - Renatus (Deif) [Rain].osu",
|
||||
"Soleily - Renatus (Deif) [Salad].osu",
|
||||
"Soleily - Renatus (ExPew) [Another].osu",
|
||||
"Soleily - Renatus (ExPew) [Hyper].osu",
|
||||
"Soleily - Renatus (ExPew) [Normal].osu",
|
||||
"Soleily - Renatus (Gamu) [Hard].osu",
|
||||
"Soleily - Renatus (Gamu) [Insane].osu",
|
||||
"Soleily - Renatus (Gamu) [Normal].osu",
|
||||
"Soleily - Renatus (MMzz) [Futsuu].osu",
|
||||
"Soleily - Renatus (MMzz) [Muzukashii].osu",
|
||||
"Soleily - Renatus (MMzz) [Oni].osu"
|
||||
};
|
||||
var maps = reader.ReadBeatmaps();
|
||||
foreach (var map in expected)
|
||||
Assert.Contains(map, maps);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
15
osu.Game.Tests/Resources/Resource.cs
Normal file
15
osu.Game.Tests/Resources/Resource.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
|
||||
namespace osu.Game.Tests.Resources
|
||||
{
|
||||
public static class Resource
|
||||
{
|
||||
public static string GetPath(string path)
|
||||
{
|
||||
var assemblyDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
|
||||
return Path.Combine(assemblyDir, "Resources", path);
|
||||
}
|
||||
}
|
||||
}
|
57
osu.Game.Tests/osu.Game.Tests.csproj
Normal file
57
osu.Game.Tests/osu.Game.Tests.csproj
Normal file
@ -0,0 +1,57 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{54377672-20B1-40AF-8087-5CF73BF3953A}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>osu.Game.Tests</RootNamespace>
|
||||
<AssemblyName>osu.Game.Tests</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG;</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="nunit.framework">
|
||||
<HintPath>..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
<None Include="Resources\241526 Soleily - Renatus.osz">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\osu.Game\osu.Game.csproj">
|
||||
<Project>{0D3FBF8A-7464-4CF7-8C90-3E7886DF2D4D}</Project>
|
||||
<Name>osu.Game</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Resources\" />
|
||||
<Folder Include="Beatmaps\" />
|
||||
<Folder Include="Beatmaps\IO\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Beatmaps\IO\OszArchiveReaderTest.cs" />
|
||||
<Compile Include="Resources\Resource.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
4
osu.Game.Tests/packages.config
Normal file
4
osu.Game.Tests/packages.config
Normal file
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="NUnit" version="2.6.4" targetFramework="net45" />
|
||||
</packages>
|
Reference in New Issue
Block a user