public void BeforeEach()
        {
            _addButtonMock = new Mock<IRibbonButtonControl>();
            _saveButtonMock = new Mock<IRibbonButtonControl>();

            _ribbonControlFactoryMock = new Mock<IRibbonControlFactory>();
            _ribbonControlFactoryMock.Setup(f => f.CreateRibbonButton("TK_Add")).Returns(_addButtonMock.Object).Verifiable();
            _ribbonControlFactoryMock.Setup(f => f.CreateRibbonButton("TK_Save")).Returns(_saveButtonMock.Object).Verifiable();

            _crudRibbonControlGroupMock = new Mock<IRibbonControlGroup>();
            _crudRibbonControlGroupMock.SetupAllProperties();
            _ribbonControlFactoryMock.Setup(f => f.CreateRibbonControlGroup("TK_Crud")).Returns(_crudRibbonControlGroupMock.Object).Verifiable();

            _crudRibbonTabRibbonControlGroupsMock = new Mock<ICollection<IRibbonControlGroup>>();
            _crudRibbonTabRibbonControlGroupsMock.SetupAllProperties();

            _crudRibbonTabMock = new Mock<IRibbonTab>();
            _crudRibbonTabMock.Setup(t => t.RibbonControlGroups).Returns(_crudRibbonTabRibbonControlGroupsMock.Object);

            _ribbonTabFactoryMock = new Mock<IRibbonTabFactory>();
            _ribbonTabFactoryMock.Setup(f => f.Create("TK_Crud")).Returns(_crudRibbonTabMock.Object);

            _ribbonViewModelTabsMock = new Mock<ICollection<IRibbonTab>>();
            _ribbonViewModelTabsMock.SetupAllProperties();

            _ribbonViewModelMock = new Mock<IRibbonViewModel>();
            _ribbonViewModelMock.Setup(r => r.RibbonTabs).Returns(_ribbonViewModelTabsMock.Object).Verifiable();
            _ribbonViewModelMock.SetupSet(r => r.SelectedTab = _crudRibbonTabMock.Object).Verifiable();

            var dependenciesMock = new Mock<ICrudGroupControllerDependencies>();
            dependenciesMock.SetupGet(d => d.RibbonControlFactory).Returns(_ribbonControlFactoryMock.Object);
            dependenciesMock.SetupGet(d => d.RibbonTabFactory).Returns(_ribbonTabFactoryMock.Object);
            dependenciesMock.SetupGet(d => d.RibbonViewModel).Returns(_ribbonViewModelMock.Object);

            _crudGroupController = new CrudGroupController(dependenciesMock.Object);
        }
        public void BeforeEach()
        {
            _listViewModelMock = new Mock<IListViewModel>();

            _addButtonMock = new Mock<IRibbonButtonControl>();
            _saveButtonMock = new Mock<IRibbonButtonControl>();

            _saveButtonMock.SetupSet(b => b.ExecuteAction = It.IsAny<Action>()).Callback<Action>(a => _saveButtonExecuteAction = a);
            _saveButtonMock.SetupSet(b => b.CanExecute = It.IsAny<Func<bool>>()).Callback<Func<bool>>(f => _saveButtonCanExecuteFunc = f);
            _saveButtonMock.Setup(b => b.RaiseCanExecuteChanged()).Verifiable();

            _ribbonControlFactoryMock = new Mock<IRibbonControlFactory>();
            _ribbonControlFactoryMock.Setup(f => f.CreateRibbonButton("TK_Add")).Returns(_addButtonMock.Object).Verifiable();
            _ribbonControlFactoryMock.Setup(f => f.CreateRibbonButton("TK_Save")).Returns(_saveButtonMock.Object).Verifiable();

            _crudRibbonControlGroupMock = new Mock<IRibbonControlGroup>();
            _crudRibbonControlGroupMock.SetupAllProperties();
            _ribbonControlFactoryMock.Setup(f => f.CreateRibbonControlGroup("TK_Crud")).Returns(_crudRibbonControlGroupMock.Object).Verifiable();

            _crudRibbonTabMock = new Mock<IRibbonTab>();
            _crudRibbonTabMock.Setup(t => t.RibbonControlGroups).Returns(new Collection<IRibbonControlGroup>());

            _ribbonTabFactoryMock = new Mock<IRibbonTabFactory>();
            _ribbonTabFactoryMock.Setup(f => f.Create("TK_Crud")).Returns(_crudRibbonTabMock.Object);

            _ribbonViewModelMock = new Mock<IRibbonViewModel>();
            _ribbonViewModelMock.Setup(r => r.RibbonTabs).Returns(new Collection<IRibbonTab>()).Verifiable();

            var dependenciesMock = new Mock<ICrudGroupControllerDependencies>();
            dependenciesMock.SetupGet(d => d.RibbonControlFactory).Returns(_ribbonControlFactoryMock.Object);
            dependenciesMock.SetupGet(d => d.RibbonTabFactory).Returns(_ribbonTabFactoryMock.Object);
            dependenciesMock.SetupGet(d => d.RibbonViewModel).Returns(_ribbonViewModelMock.Object);

            _crudGroupController = new CrudGroupController(dependenciesMock.Object);
        }