Exemple #1
0
        public void Synchronize_RemovesReference_ProjectRemoved()
        {
            var references = AddRemoveReferencesSetup.DummyProjectsList.ToList();
            var updates    = AddRemoveReferencesSetup.DummyProjectsList.Take(references.Count - 1).ToList();
            var expected   = updates.Select(reference => reference.Name).OrderBy(_ => _).ToList();

            var folder = new CodeExplorerReferenceFolderViewModel(null, null, references, ReferenceKind.Project);

            folder.Synchronize(null, updates);
            var actual = folder.Children.Cast <CodeExplorerReferenceViewModel>().Select(reference => reference.Reference.Name).OrderBy(_ => _);

            Assert.IsTrue(expected.SequenceEqual(actual));
        }
Exemple #2
0
        public void Synchronize_PlacesAllReferences_TypeLibraries_NoChanges()
        {
            var references = AddRemoveReferencesSetup.DummyReferencesList;
            var folder     = new CodeExplorerReferenceFolderViewModel(null, null, references, ReferenceKind.TypeLibrary);

            var updates  = AddRemoveReferencesSetup.DummyReferencesList;
            var expected = updates.Select(reference => reference.Name).OrderBy(_ => _).ToList();

            folder.Synchronize(null, updates);
            var actual = folder.Children.Cast <CodeExplorerReferenceViewModel>().Select(reference => reference.Reference.Name).OrderBy(_ => _);

            Assert.IsTrue(expected.SequenceEqual(actual));
        }