Пример #1
0
        public void ShouldAddEncoderSettingsViewToMainRegion()
        {
            var regionManager = new MockRegionManager();
            var container     = new MockUnityResolver();

            container.Bag.Add(typeof(IEncoderSettingsPresentationModel), new MockEncoderSettingsPresentationModel());
            MockRegion mainRegion = new MockRegion {
                Name = "MainRegion"
            };
            MockRegion menuRegion = new MockRegion {
                Name = "MenuRegion"
            };

            regionManager.Regions.Add(mainRegion);
            regionManager.Regions.Add(menuRegion);

            MockOutputMenuButtonViewModel outputMenuButtonViewModel = new MockOutputMenuButtonViewModel();

            container.Bag[typeof(IMenuButtonViewModel)] = outputMenuButtonViewModel;

            var module = new EncoderOutputModule(container, regionManager, new MockWindowManager());

            Assert.AreEqual(0, mainRegion.AddedViews.Count);

            module.Initialize();

            Assert.AreEqual(1, mainRegion.AddedViews.Count);
            Assert.IsInstanceOfType(mainRegion.AddedViews[0], typeof(IEncoderSettingsView));
        }
Пример #2
0
        public void ShouldAddEncoderSettingsViewToToolsRegion()
        {
            var toolsRegion   = new MockRegion();
            var regionManager = new MockRegionManager();
            var container     = new MockUnityResolver();

            container.Bag.Add(typeof(IEncoderSettingsPresentationModel), new MockEncoderSettingsPresentationModel());
            toolsRegion.Name = "ToolsRegion";
            regionManager.Regions.Add(toolsRegion);

            var module = new EncoderOutputModule(container, regionManager);

            Assert.AreEqual(0, toolsRegion.AddedViews.Count);

            module.Initialize();

            Assert.AreEqual(1, toolsRegion.AddedViews.Count);
            Assert.IsInstanceOfType(toolsRegion.AddedViews[0], typeof(IEncoderSettingsView));
        }