Example #1
0
        private ReportAssembly AddAssembly(Assembly assembly)
        {
            if (assembly == null)
            {
                throw new ArgumentNullException("assembly");
            }

            if (this.assemblies.Contains(assembly.FullName))
            {
                return((ReportAssembly)this.assemblies[assembly.FullName]);
            }

            ReportAssembly ra = new ReportAssembly();

            ra.FullName = assembly.FullName;
            AssemblyName an = assembly.GetName();

            ra.Name             = an.Name;
            ra.Location         = assembly.CodeBase;
            ra.Version          = new ReportAssemblyVersion();
            ra.Version.Major    = an.Version.Major;
            ra.Version.Minor    = an.Version.Minor;
            ra.Version.Build    = an.Version.Build;
            ra.Version.Revision = an.Version.Revision;

            // store
            this.assemblies.Add(assembly.FullName, ra);

            // add to report
            this.result.Assemblies.AddReportAssembly(ra);

            return(ra);
        }
Example #2
0
		public virtual void VisitAssembly(ReportAssembly assembly)
		{
			VisitAssemblyVersion(assembly.Version);
            if (assembly.SetUp != null)
                VisitAssemblySetUp(assembly.SetUp);
            if (assembly.TearDown != null)
                VisitAssemblyTearDown(assembly.TearDown);

            foreach(ReportNamespace ns in assembly.Namespaces)
				VisitNamespace(ns);
		}
Example #3
0
        public virtual void VisitAssembly(ReportAssembly assembly)
        {
            VisitAssemblyVersion(assembly.Version);
            if (assembly.SetUp != null)
            {
                VisitAssemblySetUp(assembly.SetUp);
            }
            if (assembly.TearDown != null)
            {
                VisitAssemblyTearDown(assembly.TearDown);
            }

            foreach (ReportNamespace ns in assembly.Namespaces)
            {
                VisitNamespace(ns);
            }
        }
        private ReportAssembly AddAssembly(Assembly assembly)
        {
            if (assembly == null)
                throw new ArgumentNullException("assembly");

            if (this.assemblies.Contains(assembly.FullName))
                return (ReportAssembly)this.assemblies[assembly.FullName];

            ReportAssembly ra = new ReportAssembly();
            ra.FullName = assembly.FullName;
            AssemblyName an = assembly.GetName();
            ra.Name = an.Name;
            ra.Location = assembly.CodeBase;
            ra.Version = new ReportAssemblyVersion();
            ra.Version.Major = an.Version.Major;
            ra.Version.Minor = an.Version.Minor;
            ra.Version.Build = an.Version.Build;
            ra.Version.Revision = an.Version.Revision;

            // store
            this.assemblies.Add(assembly.FullName, ra);

            // add to report
            this.result.Assemblies.AddReportAssembly(ra);

            return ra;
        }
Example #5
0
 /// <summary />
 /// <remarks />
 public void RemoveReportAssembly(ReportAssembly o) {
     this.List.Remove(o);
 }
Example #6
0
 /// <summary />
 /// <remarks />
 public bool ContainsReportAssembly(ReportAssembly o) {
     return this.List.Contains(o);
 }
Example #7
0
 /// <summary />
 /// <remarks />
 public void AddReportAssembly(ReportAssembly o) {
     this.List.Add(o);
 }
Example #8
0
        public void AssemblySetUp(Assembly assembly, ReportSetUpAndTearDown setUp)
        {
            ReportAssembly a = this.AddAssembly(assembly);

            a.SetUp = setUp;
        }
Example #9
0
        private ReportNamespace AddNamespace(Type fixtureType)
        {
            // get assembly
            ReportAssembly ra = AddAssembly(fixtureType.Assembly);

            // get namespace
            string ns = fixtureType.Namespace;

            if (ns == null || ns.Length == 0)
            {
                ns = "";
            }

            string[] partialNs = partialNs = ns.Split('.');

            // find root
            string          rootName = partialNs[0];
            ReportNamespace parent   = null;

            foreach (ReportNamespace rns in ra.Namespaces)
            {
                if (rns.Name == rootName)
                {
                    parent = rns;
                    break;
                }
            }

            // if not found add new
            if (parent == null)
            {
                parent      = new ReportNamespace();
                parent.Name = rootName;
                ra.Namespaces.AddReportNamespace(parent);
                this.namespaces.Add(parent.Name, parent);
            }

            // add childn amespaces
            string currentNs = parent.Name;

            for (int i = 1; i < partialNs.Length; ++i)
            {
                currentNs += String.Format(".{0}", partialNs[i]);
                // if !contained, add
                if (!this.namespaces.Contains(currentNs))
                {
                    ReportNamespace rns = new ReportNamespace();
                    rns.Name = currentNs;

                    // add in table
                    this.namespaces.Add(currentNs, rns);
                    parent.Namespaces.AddReportNamespace(rns);
                    parent = rns;
                }
                else
                {
                    // add to parent
                    parent = (ReportNamespace)this.namespaces[currentNs];
                }
            }

            return((ReportNamespace)this.namespaces[ns]);
        }
Example #10
0
        public void AssemblyTearDown(Assembly assembly, ReportSetUpAndTearDown tearDown)
        {
            ReportAssembly a = this.AddAssembly(assembly);

            a.TearDown = tearDown;
        }
Example #11
0
			public override void VisitAssembly(ReportAssembly assembly)
			{
				writer.WriteLine("-- {0}",assembly.Name);
				base.VisitAssembly(assembly);
			}
Example #12
0
 /// <summary />
 /// <remarks />
 public void RemoveReportAssembly(ReportAssembly o)
 {
     this.List.Remove(o);
 }
Example #13
0
 /// <summary />
 /// <remarks />
 public bool ContainsReportAssembly(ReportAssembly o)
 {
     return(this.List.Contains(o));
 }
Example #14
0
 /// <summary />
 /// <remarks />
 public void AddReportAssembly(ReportAssembly o)
 {
     this.List.Add(o);
 }