Represents a collection of key mappings for in-game actions.
        public void SetKeyBinding_Should_Set_Correct_Binding()
        {
            var layout = new KeyLayout(DummyBindingList.ToArray());

            layout.SetKeyBinding(0, 1, 10);

            VerifyKeyBinding(layout.GetKeyBinding(0), layout.Bindings[0]);
        }
        public void GetKeyBinding_Should_Throw_On_Invalid_Id()
        {
            var layout = new KeyLayout(DummyBindingList);

            layout
            .Invoking(l => l.GetKeyBinding(InvalidKeyId))
            .ShouldThrow <ArgumentOutOfRangeException>();
        }
        public void Constructed_Bindings_List_Should_Be_The_Same()
        {
            var layout = new KeyLayout(DummyBindingList);

            layout.Bindings.Should().HaveSameCount(DummyBindingList);
            layout.Bindings.ShouldAllBeEquivalentTo(
                DummyBindingList,
                eq => eq.Including(kb => kb.ActionId)
                .Including(kb => kb.ActionTypeId));
        }
Esempio n. 4
0
        public void Constructed_Bindings_List_Should_Be_The_Same()
        {
            var layout = new KeyLayout(DummyBindingList);

            layout.Bindings.Should().HaveSameCount(DummyBindingList);
            layout.Bindings.ShouldAllBeEquivalentTo(
                DummyBindingList,
                eq => eq.Including(kb => kb.ActionId)
                        .Including(kb => kb.ActionTypeId));
        }
        public void GetKeyBinding_Should_Return_Correct_Binding()
        {
            var layout = new KeyLayout(DummyBindingList);

            VerifyKeyBinding(layout.GetKeyBinding(0), layout.Bindings[0]);
        }
Esempio n. 6
0
        public void GetKeyBinding_Should_Throw_On_Invalid_Id()
        {
            var layout = new KeyLayout(DummyBindingList);

            layout
                .Invoking(l => l.GetKeyBinding(InvalidKeyId))
                .ShouldThrow<ArgumentOutOfRangeException>();
        }
Esempio n. 7
0
 public void GetKeyBinding_Should_Return_Correct_Binding()
 {
     var layout = new KeyLayout(DummyBindingList);
     VerifyKeyBinding(layout.GetKeyBinding(0), layout.Bindings[0]);
 }
Esempio n. 8
0
        public void SetKeyBinding_Should_Set_Correct_Binding()
        {
            var layout = new KeyLayout(DummyBindingList.ToArray());
            layout.SetKeyBinding(0, 1, 10);

            VerifyKeyBinding(layout.GetKeyBinding(0), layout.Bindings[0]);
        }