| Class: | FakeXrmEasy.XrmFakedTracingService |
|---|---|
| Assembly: | FakeXrmEasy |
| File(s): | C:\code\jordimontana82\fake-xrm-easy\FakeXrmEasy.Shared\XrmFakedTracingService.cs |
| Covered lines: | 18 |
| Uncovered lines: | 0 |
| Coverable lines: | 18 |
| Total lines: | 35 |
| Line coverage: | 100% |
| Branch coverage: | 100% |
| Method | Cyclomatic Complexity | Sequence Coverage | Branch Coverage |
|---|---|---|---|
| .ctor() | 1 | 100 | 100 |
| Trace(...) | 2 | 100 | 100 |
| DumpTrace() | 1 | 100 | 100 |
| # | Line | Line coverage | ||
|---|---|---|---|---|
1 | using Microsoft.Xrm.Sdk; | |||
2 | using System; | |||
3 | using System.Text; | |||
4 | | |||
5 | namespace FakeXrmEasy | |||
6 | { | |||
7 | public class XrmFakedTracingService : ITracingService | |||
8 | { | |||
| 685 | 9 | protected StringBuilder _trace { get; set; } | ||
10 | | |||
| 199 | 11 | public XrmFakedTracingService() | ||
| 199 | 12 | { | ||
| 199 | 13 | _trace = new StringBuilder(); | ||
| 199 | 14 | } | ||
15 | | |||
16 | public void Trace(string format, params object[] args) | |||
| 810 | 17 | { | ||
| 810 | 18 | if (args.Length == 0) | ||
| 402 | 19 | { | ||
| 402 | 20 | Trace("{0}", format); | ||
| 402 | 21 | } | ||
22 | else | |||
| 408 | 23 | { | ||
| 408 | 24 | Console.WriteLine(format, args); | ||
25 | | |||
| 408 | 26 | _trace.AppendLine(string.Format(format, args)); | ||
| 1218 | 27 | }; | ||
| 810 | 28 | } | ||
29 | | |||
30 | public string DumpTrace() | |||
| 78 | 31 | { | ||
| 78 | 32 | return _trace.ToString(); | ||
| 78 | 33 | } | ||
34 | } | |||
35 | } |