2021-01-26 15:14:04 +00:00
|
|
|
|
using System.Linq;
|
|
|
|
|
using Xunit;
|
|
|
|
|
|
|
|
|
|
namespace Wabbajack.Common.Test
|
|
|
|
|
{
|
|
|
|
|
public class GameTests
|
|
|
|
|
{
|
|
|
|
|
[Fact]
|
|
|
|
|
public void TestGetGameFromMO2ArchiveName()
|
|
|
|
|
{
|
|
|
|
|
var games = GameRegistry.Games.Select(x => (name: x.Value.MO2Name, game: x.Key));
|
|
|
|
|
foreach (var (name, game) in games)
|
|
|
|
|
{
|
|
|
|
|
if (name == null) continue;
|
|
|
|
|
var result = GameRegistry.TryGetByFuzzyName(name);
|
|
|
|
|
Assert.NotNull(result);
|
|
|
|
|
Assert.Equal(game, result.Game);
|
|
|
|
|
}
|
|
|
|
|
}
|
2021-06-12 20:31:35 +00:00
|
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
|
public void GamePathsDontIncludeDuplicateBackslash()
|
|
|
|
|
{
|
|
|
|
|
var path = Game.Morrowind.MetaData().GameLocation();
|
|
|
|
|
Assert.DoesNotContain("\\\\", path.ToString());
|
|
|
|
|
}
|
2021-01-26 15:14:04 +00:00
|
|
|
|
}
|
|
|
|
|
}
|