public void WhenIPressSaveFromThePresetMenu() { var configMock = new Mock<IApplicationConfig>(); var presetManager = new PresetsManager(configMock.Object, _stateMock.Object, _pluginManagerMock.Object); var viewModel = new MenuViewModel(_stateMock.Object, _pluginManagerMock.Object, configMock.Object, presetManager); viewModel.SaveMediaPresetCommand.Execute(_tempPresetFilePath); }
public void WhenILoadTheFileUsingThePresetMenu(string filePath) { var sphereProjectionPlugin = new SpherePlugin(); var projections = new List<IPlugin<IProjection>> { sphereProjectionPlugin }; _pluginManagerMock.Setup(mock => mock.Projections).Returns(projections); _stateMock = new Mock<IApplicationState>(); _stateMock.SetupAllProperties(); var configMock = new Mock<IApplicationConfig>(); var presetManager = new PresetsManager(configMock.Object, _stateMock.Object, _pluginManagerMock.Object); var viewModel = new MenuViewModel(_stateMock.Object, _pluginManagerMock.Object, configMock.Object, presetManager); viewModel.LoadMediaPresetCommand.Execute(filePath); }
public Menu() { InitializeComponent(); try { _viewModel = ((App)Application.Current).ViewModelFactory.CreateMenuViewModel(); DataContext = _viewModel; } catch (Exception exc) { Logger.Instance.Error("Error while initilizing Menu view.", exc); } }