Example #1
0
        public void UnknownAssemblyDoesNotThrow()
        {
            var project  = new XunitProject();
            var assembly = new XunitProjectAssembly();

            Assert.DoesNotThrow(() => project.RemoveAssembly(assembly));
        }
Example #2
0
        void UnloadAssemblies(IEnumerable assemblyListViewItems)
        {
            foreach (ListViewItem assemblyListViewItem in assemblyListViewItems)
            {
                TestAssembly testAssembly = (TestAssembly)assemblyListViewItem.Tag;

                RemoveFileWatcher(testAssembly);
                listAssemblies.Items.Remove(assemblyListViewItem);
                mate.Unload(testAssembly);

                XunitProjectAssembly toRemove = null;

                foreach (XunitProjectAssembly assembly in project.Assemblies)
                {
                    if (assembly.AssemblyFilename == testAssembly.AssemblyFilename &&
                        assembly.ConfigFilename == testAssembly.ConfigFilename)
                    {
                        toRemove = assembly;
                        break;
                    }
                }

                if (toRemove != null)
                {
                    project.RemoveAssembly(toRemove);
                }
            }

            UpdateAssemblyFilter();
            UpdateTestList();
            UpdateTraitsList();
            UpdateAssemblyDynamicMenus();
        }
Example #3
0
        public void RemovesAssemblyFromAssembliesList()
        {
            var project  = new XunitProject();
            var assembly = new XunitProjectAssembly();

            project.AddAssembly(assembly);

            project.RemoveAssembly(assembly);

            Assert.DoesNotContain(assembly, project.Assemblies);
        }
Example #4
0
        public void ProjectIsDirtyWhenRemovingAssembly()
        {
            var project  = new XunitProject();
            var assembly = new XunitProjectAssembly();

            project.AddAssembly(assembly);
            project.IsDirty = false;

            project.RemoveAssembly(assembly);

            Assert.True(project.IsDirty);
        }
Example #5
0
        public void NullAssemblyThrows()
        {
            var project = new XunitProject();

            Assert.Throws <ArgumentNullException>(() => project.RemoveAssembly(null));
        }