public void ConfigurationFactoryInput_Test()
        {
            IInputMapping mapping = JsonConvert.DeserializeObject <InputMapping>
                                        (TestUtilities.GetStringResource("InputMappings.DirectInput.KEYBOARD_DEVICE.json"));

            var configFactory = new TestConfigurationFactory(new[] { mapping });

            var realLayout =
                JsonConvert.DeserializeObject <ControllerLayout>(
                    TestUtilities.GetStringResource("InputMappings.keyboard_device.json"));

            var targetLayout =
                JsonConvert.DeserializeObject <ControllerLayout>(
                    TestUtilities.GetStringResource("InputMappings.xinput_device.json"));

            var fakeInputDevice = new Mock <IInputDevice>();

            fakeInputDevice.Setup(p => p.DeviceId).Returns("KEYBOARD_DEVICE");
            fakeInputDevice.Setup(p => p.DeviceLayout).Returns(realLayout);
            fakeInputDevice.Setup(p => p.DeviceApi).Returns(InputApi.DirectInput);

            var map = ControllerElementMappings.GetDefaultMappings(realLayout, targetLayout);
            var emulatedController = new EmulatedController(0, fakeInputDevice.Object, targetLayout, map);

            (IInputTemplate template, IInputMapping inputMappings) = configFactory.GetInputMappings(emulatedController);
            Assert.Equal(ControllerElement.KeyZ, template[ControllerElement.ButtonA]);
        }
        public void ConfigurationFactoryCreation_Tests()
        {
            IInputMapping mapping = JsonConvert.DeserializeObject <InputMapping>
                                        (TestUtilities.GetStringResource("InputMappings.DirectInput.KEYBOARD_DEVICE.json"));

            var configFactory = new TestConfigurationFactory(new[] { mapping });
        }
        public void ConfigurationFactoryConfiguration_Test()
        {
            IInputMapping mapping = JsonConvert.DeserializeObject <InputMapping>
                                        (TestUtilities.GetStringResource("InputMappings.DirectInput.KEYBOARD_DEVICE.json"));

            var configFactory = new TestConfigurationFactory(new[] { mapping });
            var config        = configFactory.GetConfiguration();

            Assert.Equal(config.Configuration.ExampleConfiguration.FullscreenResolution,
                         new ConfigurationCollection <ExampleConfigurationCollection>().Configuration.ExampleConfiguration
                         .FullscreenResolution);
            Assert.Equal(config.Configuration.ExampleConfiguration.FullscreenResolution,
                         ((IConfigurationFactory)configFactory).GetConfiguration()["ExampleConfiguration"][
                             "FullscreenResolution"]);
        }