using System; using UnitTestSharp; namespace Clave.Glass.UnitTests { public class KeyBindingsTextTests : TestFixture { public class DescribeTests : TestFixture { public void BothFire_SaysAlso() { CheckEqual("Also Jump", KeyBindingsText.English.Describe(new KeyClash(ChordConflictKind.BothFire, "Jump"))); } public void HiddenBy_SaysTakenBy() { CheckEqual("Taken by Pause", KeyBindingsText.English.Describe(new KeyClash(ChordConflictKind.HiddenBy, "Pause"))); } public void NoName_UsesTheWordForOne() { CheckEqual("Also another shortcut", KeyBindingsText.English.Describe(new KeyClash(ChordConflictKind.BothFire, null))); } public void TranslatedFormats_AreUsed() { var text = new KeyBindingsText { BothFireFormat = "Aussi {0}", Unnamed = "autre" }; CheckEqual("Aussi autre", text.Describe(new KeyClash(ChordConflictKind.BothFire, null))); } public void Hides_Throws() { CheckThrow(typeof(ArgumentOutOfRangeException)); KeyBindingsText.English.Describe(new KeyClash(ChordConflictKind.Hides, "Jump")); } } } }