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

            var fileMenuItems = loaderConfig.GetFileMenuItemsCollection();

            Assert.IsNotNull(fileMenuItems);
            Assert.AreEqual(0, fileMenuItems.Count);
        }
        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 LoadSettings_WillLoadAllData_Always()
        {
            var loaderConfig = new Fake_LoaderConfiguration();
            loaderConfig.ForcedSettingsToLoad[LoaderConfiguration.SettingsName_AssemblyFullPath] = @"C:\abc\someModule.DLL";
            loaderConfig.ForcedSettingsToLoad[LoaderConfiguration.SettingsName_Type] = "SomeNamespace.SomeType";
            loaderConfig.ForcedSettingsToLoad[LoaderConfiguration.SettingsName_ToAddMergedDictionary] = "pack://*****:*****@"C:\one.dll", @"C:\two.dll" };

            loaderConfig.LoadSettings();

            Assert.AreEqual(@"C:\abc\someModule.DLL", loaderConfig.AssemblyOfPreviewedGui);
            Assert.AreEqual("SomeNamespace.SomeType", loaderConfig.TypeOfPreviewedGui);
            Assert.AreEqual("pack://*****:*****@"C:\one.dll", loaderConfig.GetFileMenuItemsCollection()[1].Title); // skip [0] since it's just a Separator
            Assert.AreEqual(@"C:\two.dll", loaderConfig.GetFileMenuItemsCollection()[2].Title); // skip [0] since it's just a Separator
        }