public void AddMruItem_WillCreateSingleEntry_WhenSameAssemblyAddedTwoTimes()
        {
            var loaderConfig = new Fake_LoaderConfiguration();

            loaderConfig.AddMruItem(@"C:\one.dll");
            loaderConfig.AddMruItem(@"C:\one.dll");

            var fileMenuItems = loaderConfig.GetFileMenuItemsCollection();

            Assert.AreEqual(2, fileMenuItems.Count); // 1st one is just the Separator
            Assert.AreEqual(@"C:\one.dll", fileMenuItems[1].Title);
        }
        public void AddMruItem_WillMoveAssemblyToTop_WhenThatAssemblyNotAtTop()
        {
            var loaderConfig = new Fake_LoaderConfiguration();
            loaderConfig.AddMruItem(@"C:\one.dll");
            loaderConfig.AddMruItem(@"C:\two.dll");
            loaderConfig.AddMruItem(@"C:\three.dll");

            loaderConfig.AddMruItem(@"C:\two.dll");

            var fileMenuItems = loaderConfig.GetFileMenuItemsCollection();
            Assert.AreEqual(4, fileMenuItems.Count); // 1st one is just the Separator
            Assert.AreEqual(@"C:\two.dll", fileMenuItems[1].Title);
            Assert.AreEqual(@"C:\three.dll", fileMenuItems[2].Title);
            Assert.AreEqual(@"C:\one.dll", fileMenuItems[3].Title);
        }
        public void GetFileMenuItemsCollection_ReturnsSeparatorPlus3ItemsInReversedOrder_When3DifferentMruItemsAdded()
        {
            var loaderConfig = new Fake_LoaderConfiguration();
            loaderConfig.AddMruItem(@"C:\abc.dll");
            loaderConfig.AddMruItem(@"C:\abc2.dll");
            loaderConfig.AddMruItem(@"C:\abc3.dll");

            var fileMenuItems = loaderConfig.GetFileMenuItemsCollection();

            Assert.AreEqual(true, fileMenuItems[0].IsSeparator);
            Assert.AreEqual(false, fileMenuItems[1].IsSeparator);
            Assert.AreEqual(@"C:\abc3.dll", fileMenuItems[1].Title);
            Assert.AreEqual(@"C:\abc2.dll", fileMenuItems[2].Title);
            Assert.AreEqual(@"C:\abc.dll", fileMenuItems[3].Title);
            Assert.AreEqual(4, fileMenuItems.Count);
        }
        public void SaveSettings_WillSaveAllData_Always()
        {
            var loaderConfig = new Fake_LoaderConfiguration();
            loaderConfig.AssemblyOfPreviewedGui = @"C:\abc\someModule.DLL";
            loaderConfig.TypeOfPreviewedGui = "SomeNamespace.SomeType";
            loaderConfig.ResourceDictionaryToAdd = "pack://*****:*****@"C:\one.dll");
            loaderConfig.AddMruItem(@"C:\two.dll");

            loaderConfig.SaveSettings();

            Assert.AreEqual(5, loaderConfig.SettingsSaved.Count);
            Assert.AreEqual("C:\\abc\\someModule.DLL", loaderConfig.SettingsSaved[LoaderConfiguration.SettingsName_AssemblyFullPath]);
            Assert.AreEqual("SomeNamespace.SomeType", loaderConfig.SettingsSaved[LoaderConfiguration.SettingsName_Type]);
            Assert.AreEqual("pack://*****:*****@"C:\one.dll", mruAssemblies[0]);
            Assert.AreEqual(@"C:\two.dll", mruAssemblies[1]);
        }