public void apply_activation_button_to_all_profiles()
        {
            var subDevice         = Substitute.For <IHOTASDevice>();
            var buttonMapProfile1 = new ObservableCollection <IHotasBaseMap>();
            var button_1_1        = new HOTASButton()
            {
                MapId = 1, IsShift = false, ShiftModePage = 1
            };
            var button_1_2 = new HOTASButton()
            {
                MapId = 2, IsShift = false, ShiftModePage = 2
            };
            var button_1_3 = new HOTASAxis()
            {
                MapId = 3, ButtonMap = new ObservableCollection <HOTASButton>()
                {
                    new HOTASButton()
                    {
                        MapId = 3, ShiftModePage = 3
                    }
                }
            };

            buttonMapProfile1.Add(button_1_1);
            buttonMapProfile1.Add(button_1_2);
            buttonMapProfile1.Add(button_1_3);

            var buttonMapProfile2 = new ObservableCollection <IHotasBaseMap>();
            var button_2_1        = new HOTASButton()
            {
                MapId = 1, IsShift = false, ShiftModePage = 0
            };                                                                                    //simulate a new profile that does not have links back to previous profiles
            var button_2_2 = new HOTASButton()
            {
                MapId = 2, IsShift = false, ShiftModePage = 0
            };                                                                                    //simulate a new profile that does not have links back to previous profiles
            var button_2_3 = new HOTASAxis()
            {
                MapId = 3, ButtonMap = new ObservableCollection <HOTASButton>()
                {
                    new HOTASButton()
                    {
                        MapId = 3, ShiftModePage = 0
                    }
                }
            };

            buttonMapProfile2.Add(button_2_1);
            buttonMapProfile2.Add(button_2_2);
            buttonMapProfile2.Add(button_2_3);

            subDevice.ButtonMap.Returns(buttonMapProfile1);


            var deviceId = Guid.NewGuid();

            subDevice.DeviceId = deviceId;

            var subDeviceFactory = Substitute.For <HOTASDeviceFactory>();

            subDeviceFactory.CreateHOTASDevice(Arg.Any <IDirectInput>(), Arg.Any <Guid>(), Arg.Any <Guid>(),
                                               Arg.Any <string>(), Arg.Any <IHOTASQueue>()).Returns(subDevice);

            var profiles = new Dictionary <int, ObservableCollection <IHotasBaseMap> >()
            {
                {
                    1, buttonMapProfile1
                },
                {
                    2, buttonMapProfile2
                },
                {
                    3, buttonMapProfile2
                }
            };

            subDevice.ModeProfiles.Returns(profiles);

            var list = new HOTASCollection(Substitute.For <DirectInputFactory>(), Substitute.For <JoystickFactory>(), Substitute.For <HOTASQueueFactory>(Substitute.For <IKeyboard>()), subDeviceFactory);

            list.AddDevice(subDevice);
            list.ListenToAllDevices();

            var item1 = new ModeActivationItem()
            {
                DeviceId = deviceId,
                ButtonId = 1,
                Mode     = 1
            };

            var item2 = new ModeActivationItem()
            {
                DeviceId = deviceId,
                ButtonId = 2,
                Mode     = 2
            };

            var item3 = new ModeActivationItem()
            {
                DeviceId = deviceId,
                ButtonId = 3,
                Mode     = 3
            };

            list.ModeProfileActivationButtons.Add(1, item1);
            list.ModeProfileActivationButtons.Add(2, item2);
            list.ModeProfileActivationButtons.Add(3, item3);

            Assert.Equal(0, button_2_1.ShiftModePage);
            Assert.Equal(0, button_2_2.ShiftModePage);
            Assert.Equal(0, button_2_3.ButtonMap[0].ShiftModePage);

            list.ApplyActivationButtonToAllProfiles();

            Assert.Equal(1, button_2_1.ShiftModePage);
            Assert.Equal(2, button_2_2.ShiftModePage);
            Assert.Equal(3, button_2_3.ButtonMap[0].ShiftModePage);
        }