1
1
mirror of https://github.com/OpenDiablo2/OpenDiablo2 synced 2024-11-19 19:06:45 -05:00
OpenDiablo2/OpenDiablo2.Core.UT/UT_EngineDataManager.cs
nicholasdechiara 02e101edb8 Filled out eLevelId enum (#16)
* Filled out eLevelId enum

- Added OpenDiablo2.Core.UT unit test project
- Added ELevelIdHelper class which contains code that generates the enum from the mpq data
- Added a unit test that verifies EngineDataManager works
- Added a unit test that runs the ELevelIdHelper generate function
- Renamed some enum values for constistency (e.g. Act1_Town -> Act1_Town1, as it is in the mpq)

* Retargeted OpenDiablo2.Core.UT to .net Framework 4.6.1

* Added TestConsole

TestConsole currently only supports writing the elevelids enum to a file

Also, removed elevelids generation unit test
2018-11-25 14:12:25 -05:00

38 lines
985 B
C#

using Microsoft.VisualStudio.TestTools.UnitTesting;
using OpenDiablo2.Common.Enums;
using OpenDiablo2.Common.Models;
using System.IO;
namespace OpenDiablo2.Core.UT
{
[TestClass]
public class UT_EngineDataManager
{
private static readonly string DataPath = @"C:\PutYourMPQsHere\";
private EngineDataManager LoadData()
{
GlobalConfiguration globalconfig = new GlobalConfiguration
{
BaseDataPath = Path.GetFullPath(DataPath)
};
MPQProvider mpqprov = new MPQProvider(globalconfig);
EngineDataManager edm = new EngineDataManager(mpqprov);
return edm;
}
[TestMethod]
public void DataLoadTest()
{
EngineDataManager edm = LoadData();
Assert.IsTrue(edm.LevelDetails.Count > 0);
Assert.IsTrue(edm.LevelPresets.Count > 0);
Assert.IsTrue(edm.LevelTypes.Count > 0);
}
}
}