Example #1
0
        public override SolutionItemConfiguration CreateConfiguration(string name)
        {
            NUnitAssemblyGroupProjectConfiguration conf = new NUnitAssemblyGroupProjectConfiguration();

            conf.Name = name;
            return(conf);
        }
        public override void DeleteItem()
        {
            TestAssembly asm = CurrentNode.DataItem as TestAssembly;
            NUnitAssemblyGroupProjectConfiguration config = (NUnitAssemblyGroupProjectConfiguration)CurrentNode.GetParentDataItem(typeof(NUnitAssemblyGroupProjectConfiguration), false);

            config.Assemblies.Remove(asm);
        }
        protected override SolutionItemConfiguration OnCreateConfiguration(string name, ConfigurationKind kind)
        {
            NUnitAssemblyGroupProjectConfiguration conf = new NUnitAssemblyGroupProjectConfiguration();

            conf.Name = name;
            return(conf);
        }
		protected override void OnCreateTests ()
		{
			NUnitAssemblyGroupProjectConfiguration conf = (NUnitAssemblyGroupProjectConfiguration) project.GetConfiguration ((ItemConfigurationSelector) ActiveConfiguration);
			if (conf != null) {
				foreach (TestAssembly t in conf.Assemblies)
					Tests.Add (t);
			}
		}
		public RootTest (NUnitAssemblyGroupProject project): base (project.Name, project)
		{
			this.project = project;
			resultsPath = Path.Combine (project.BaseDirectory, "test-results");
			ResultsStore = new XmlResultsStore (resultsPath, Path.GetFileName (project.FileName));
			
			lastConfig = (NUnitAssemblyGroupProjectConfiguration) project.DefaultConfiguration;
			if (lastConfig != null)
				lastConfig.AssembliesChanged += new EventHandler (OnAssembliesChanged);
		}
		protected override void OnActiveConfigurationChanged ()
		{
			if (lastConfig != null)
				lastConfig.AssembliesChanged -= new EventHandler (OnAssembliesChanged);

			lastConfig = (NUnitAssemblyGroupProjectConfiguration) project.DefaultConfiguration;
			if (lastConfig != null)
				lastConfig.AssembliesChanged += new EventHandler (OnAssembliesChanged);

			UpdateTests ();
			base.OnActiveConfigurationChanged ();
		}
		public override void CopyFrom (ItemConfiguration other)
		{
			base.CopyFrom (other);
			
			NUnitAssemblyGroupProjectConfiguration conf = other as NUnitAssemblyGroupProjectConfiguration;
			if (conf != null) {
				assemblies.Clear ();
				foreach (TestAssembly ta in conf.Assemblies) {
					TestAssembly copy = new TestAssembly (ta.Path);
					assemblies.Add (copy);
				}
			}
		}
        protected override void OnCopyFrom(ItemConfiguration configuration, bool isRename)
        {
            base.OnCopyFrom(configuration, isRename);

            NUnitAssemblyGroupProjectConfiguration conf = configuration as NUnitAssemblyGroupProjectConfiguration;

            if (conf != null)
            {
                assemblies.Clear();
                foreach (TestAssembly ta in conf.Assemblies)
                {
                    TestAssembly copy = new TestAssembly(ta.Path);
                    assemblies.Add(copy);
                }
            }
        }
 internal TestAssemblyCollection(NUnitAssemblyGroupProjectConfiguration owner)
 {
     this.owner = owner;
 }
		internal TestAssemblyCollection (NUnitAssemblyGroupProjectConfiguration owner)
		{
			this.owner = owner;
		}
 public override IConfiguration CreateConfiguration(string name)
 {
     NUnitAssemblyGroupProjectConfiguration conf = new NUnitAssemblyGroupProjectConfiguration ();
     conf.Name = name;
     return conf;
 }
        protected override void OnActiveConfigurationChanged()
        {
            if (lastConfig != null)
                lastConfig.AssembliesChanged -= new EventHandler (OnAssembliesChanged);

            lastConfig = (NUnitAssemblyGroupProjectConfiguration) project.ActiveConfiguration;
            if (lastConfig != null)
                lastConfig.AssembliesChanged += new EventHandler (OnAssembliesChanged);

            UpdateTests ();
            base.OnActiveConfigurationChanged ();
        }
        public RootTest(NUnitAssemblyGroupProject project)
            : base(project.Name, project)
        {
            this.project = project;
            resultsPath = Path.Combine (project.BaseDirectory, "test-results");
            ResultsStore = new XmlResultsStore (resultsPath, Path.GetFileName (project.FileName));

            lastConfig = (NUnitAssemblyGroupProjectConfiguration) project.ActiveConfiguration;
            if (lastConfig != null)
                lastConfig.AssembliesChanged += new EventHandler (OnAssembliesChanged);
        }
		public RootTest (NUnitAssemblyGroupProject project): base (project.Name, project)
		{
			this.project = project;
			resultsPath = GetTestResultsDirectory (project.BaseDirectory);
			ResultsStore = new BinaryResultsStore (resultsPath, Path.GetFileName (project.FileName));
			
			lastConfig = (NUnitAssemblyGroupProjectConfiguration) project.DefaultConfiguration;
			if (lastConfig != null)
				lastConfig.AssembliesChanged += new EventHandler (OnAssembliesChanged);
		}
		protected override SolutionItemConfiguration OnCreateConfiguration (string name, ConfigurationKind kind)
		{
			NUnitAssemblyGroupProjectConfiguration conf = new NUnitAssemblyGroupProjectConfiguration ();
			conf.Name = name;
			return conf;
		}