Class: | FakeXrmEasy.Extensions.EntityReferenceExtensions |
---|---|
Assembly: | FakeXrmEasy |
File(s): | C:\code\jordimontana82\fake-xrm-easy\FakeXrmEasy.Shared\Extensions\EntityReferenceExtensions.cs |
Covered lines: | 4 |
Uncovered lines: | 3 |
Coverable lines: | 7 |
Total lines: | 24 |
Line coverage: | 57.1% |
Branch coverage: | 50% |
Method | Cyclomatic Complexity | Sequence Coverage | Branch Coverage |
---|---|---|---|
HasKeyAttributes(...) | 2 | 66.67 | 66.67 |
# | Line | Line coverage | ||
---|---|---|---|---|
1 | using Microsoft.Xrm.Sdk; | |||
2 | using System; | |||
3 | using System.Collections.Generic; | |||
4 | using System.Text; | |||
5 |
| |||
6 | namespace FakeXrmEasy.Extensions | |||
7 | { | |||
8 | public static class EntityReferenceExtensions | |||
9 | { | |||
10 | public static bool HasKeyAttributes(this EntityReference er) | |||
51 | 11 | { | ||
51 | 12 | if(er == null) | ||
0 | 13 | { | ||
0 | 14 | return false; | ||
15 | } | |||
16 |
| |||
17 | #if !FAKE_XRM_EASY && !FAKE_XRM_EASY_2013 && !FAKE_XRM_EASY_2015 | |||
51 | 18 | return er.KeyAttributes.Count > 0; | ||
19 | #else | |||
0 | 20 | return false; | ||
21 | #endif | |||
51 | 22 | } | ||
23 | } | |||
24 | } |