Example #1
0
        public void ShouldRetrieveDefaultFilter()
        {
            MockProject mockProject = new MockProject();

            IProjectItemsFilter result = FilterManager.GetFilterForProject(mockProject);

            Assert.IsNotNull(result);
            Assert.IsInstanceOfType(result, typeof(RegexProjectItemsFilter));
        }
Example #2
0
        public void ShouldPersistDefaultFiltersOnProject()
        {
            MockProject mockProject = new MockProject();
            string      defaultFilterExpressions =
                @"\\?desktop(\\.*)?$;\\?silverlight(\\.*)?$;\.desktop;\.silverlight;\.xaml;^service references(\\.*)?$;\.clientconfig;^web references(\\.*)?$";

            IProjectItemsFilter filter = FilterManager.GetFilterForProject(mockProject);

            Assert.IsTrue(mockProject.Globals.SetVariablePersistsCalled);
            Assert.AreEqual(defaultFilterExpressions, mockProject.Globals.Dictionary["ProjectLinkerExcludeFilter"]);
        }
Example #3
0
        public void ShouldRetrievePersistedFilters()
        {
            MockProject mockProject = new MockProject();

            mockProject.Globals.Dictionary["ProjectLinkerExcludeFilter"] = @"\.excludeMe;\.excludeMeToo";

            IProjectItemsFilter filter = FilterManager.GetFilterForProject(mockProject);

            Assert.IsFalse(filter.CanBeSynchronized(@"c:\MyFolder\abc.silverlight.excludeMe"));
            Assert.IsFalse(filter.CanBeSynchronized(@"c:\MyFolder\abc.excludeMeToo"));
            Assert.IsTrue(filter.CanBeSynchronized(@"c:\MyFolder\abc.silverlight.cs"));
            Assert.IsTrue(filter.CanBeSynchronized(@"c:\MyFolder\abc.desktop"));
            Assert.IsTrue(filter.CanBeSynchronized(@"c:\MyFolder.Silverlight\abc.cs"));
            Assert.IsTrue(filter.CanBeSynchronized(@"c:\MyFolder.desktop\abc.cs"));
            Assert.IsTrue(filter.CanBeSynchronized(@"c:\silverlight\abc.cs"));
            Assert.IsTrue(filter.CanBeSynchronized(@"c:\Desktop\abc.cs"));
            Assert.IsTrue(filter.CanBeSynchronized(@"c:\MyFolder\abc.xaml"));
        }
Example #4
0
        public void DefaultFilterShouldFilterOutFiles()
        {
            MockProject mockProject = new MockProject();

            IProjectItemsFilter filter = FilterManager.GetFilterForProject(mockProject);

            Assert.IsFalse(filter.CanBeSynchronized(@"c:\MyFolder\abc.silverlight.cs"));
            Assert.IsFalse(filter.CanBeSynchronized(@"c:\MyFolder\abc.desktop"));
            Assert.IsFalse(filter.CanBeSynchronized(@"c:\MyFolder.Silverlight\abc.cs"));
            Assert.IsFalse(filter.CanBeSynchronized(@"c:\MyFolder.desktop\abc.cs"));
            Assert.IsFalse(filter.CanBeSynchronized(@"c:\silverlight\abc.cs"));
            Assert.IsFalse(filter.CanBeSynchronized(@"c:\Desktop\abc.cs"));
            Assert.IsFalse(filter.CanBeSynchronized(@"c:\MyFolder\abc.xaml"));
            Assert.IsFalse(filter.CanBeSynchronized(@"c:\Service References\abc.xaml"));
            Assert.IsFalse(filter.CanBeSynchronized(@"c:\Web References\abc.xaml"));
            Assert.IsTrue(filter.CanBeSynchronized(@"c:\MyFolder\Service References\abc.cs"));
            Assert.IsTrue(filter.CanBeSynchronized(@"c:\MyFolder\Web References\abc.cs"));
            Assert.IsFalse(filter.CanBeSynchronized(@"c:\MyFolder\abc.clientconfig"));
        }
        protected IProjectItemsSynchronizer CreateSynchronizer(Project sourceProject, Project targetProject)
        {
            IProjectItemsFilter projectItemsFilter = FilterManager.GetFilterForProject(targetProject);

            return(new ProjectItemsSynchronizer(sourceProject, targetProject, _logger, _solution, projectItemsFilter));
        }
Example #6
0
 public void ShouldValidateArgument()
 {
     FilterManager.GetFilterForProject(null);
 }