Added KeyboardShortcut

This commit is contained in:
ManlyMarco committed 2019-08-12 23:48:18 +02:00
1 parent d9bf3ba225
commit 841cdd5b77
5 files changed
+243 -11

No files matched your search

@@ -4,6 +4,7 @@ using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.IO;
using System.Linq;
using System.Threading;
using UnityEngine;
namespace BepInEx.Configuration.Tests
{
@@ -235,5 +236,22 @@ namespace BepInEx.Configuration.Tests
w.Value = null;
Assert.AreEqual("lel", w.Value);
}
[TestMethod]
public void KeyShortcutTest()
{
var shortcut = new KeyboardShortcut(KeyCode.H, KeyCode.O, KeyCode.R, KeyCode.S, KeyCode.E, KeyCode.Y);
var s = shortcut.Serialize();
var d = KeyboardShortcut.Deserialize(s);
Assert.AreEqual(shortcut, d);
var c = MakeConfig();
var w = c.Wrap("Cat", "Key", new KeyboardShortcut(KeyCode.A, KeyCode.LeftShift));
Assert.AreEqual(new KeyboardShortcut(KeyCode.A, KeyCode.LeftShift), w.Value);
w.Value = shortcut;
c.Reload();
Assert.AreEqual(shortcut, w.Value);
}
}
}