Beispiel #1
0
		public void TestProperties()
		{
			Coverage coverage = new Coverage();
			ReportSettings settings = new ReportSettings();
			coverage.Settings = settings;

			Assert.AreEqual(settings, coverage.Settings);
		}
Beispiel #2
0
		public void Setup()
		{
			this.settings = new ReportSettings();
		
			this.settings.BaseDir = "c:\\foo\\";
			this.settings.ReportName = "Test";
			this.settings.ReportDir = "bar";
		}
Beispiel #3
0
		public void TestConstructors()
		{
			Coverage coverage;

			coverage = new Coverage();
			Assert.IsNotNull(coverage.Settings);

			ReportSettings settings = new ReportSettings();
			CoveragePoint[] points = new CoveragePoint[0];

			coverage = new Coverage(settings, points);
			Assert.AreEqual(settings, coverage.Settings);
			Assert.AreEqual(points, coverage.CoveragePoints);
		}
Beispiel #4
0
		public TestParser(ReportSettings Settings)
		{
			this.settings = Settings;
			this.coveragepoints = new ArrayList();
			
			AddCoveragePointDelegate addpointdel = new AddCoveragePointDelegate(this.AddCoveragePoint);

			this.matchers = new ArrayList();
			this.matchers.Add(new StatementMatcher(addpointdel));
			this.matchers.Add(new ConditionalMatcher(addpointdel));
			this.matchers.Add(new CatchBlockMatcher(addpointdel));
			this.matchers.Add(new MethodMatcher(addpointdel));
			this.matchers.Add(new FlattenMatcher(addpointdel));
			this.matchers.Add(new UnflattenMatcher(addpointdel));
		}
Beispiel #5
0
		public void TestGetCoverageCode()
		{
			string str = "SharpCover.Results.Add(@\"foo\", @\"" + Environment.CurrentDirectory + "\\bar\\foo-actual.xml\", 20)";
			
			ReportSettings settings = new ReportSettings();
			settings.ReportName = "foo";
			settings.ReportDir = "bar";

			this.point.AbsoluteNumber = 20;

			Parser parser = new Parser(settings);
			Assert.AreEqual(str, parser.GetCoverageCode(settings, this.point));
		}
Beispiel #6
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Coverage"/> class.
        /// </summary>
        /// <param name="settings">The settings.</param>
        /// <param name="points">The points.</param>
		public Coverage(ReportSettings settings, CoveragePoint[] points)
		{
			this.settings = settings;
			this.CoveragePoints = points;
		}