mirror of
https://github.com/BepInEx/BepInEx.git
synced 2026-10-20 01:46:13 +00:00
Added KeyboardShortcut
This commit is contained in:
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user