-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fix a few scenarios and add a few test around foreign keys witho…
…ut reference nav props
- Loading branch information
Showing
8 changed files
with
109 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
src/IntelliTect.Coalesce.Tests/Util/PropertyViewModelDataAttribute.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
using IntelliTect.Coalesce.TypeDefinition; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Reflection; | ||
|
||
namespace IntelliTect.Coalesce.Tests.Util | ||
{ | ||
internal class PropertyViewModelDataAttribute : Xunit.Sdk.DataAttribute | ||
{ | ||
private readonly Type targetClass; | ||
private readonly string propName; | ||
private readonly object[] inlineData; | ||
|
||
protected bool reflection = true; | ||
protected bool symbol = true; | ||
|
||
public PropertyViewModelDataAttribute(Type targetClass, string propName, params object[] additionalInlineData) | ||
{ | ||
this.targetClass = targetClass; | ||
this.propName = propName; | ||
this.inlineData = additionalInlineData; | ||
} | ||
|
||
public override IEnumerable<object[]> GetData(MethodInfo testMethod) | ||
{ | ||
if (reflection) yield return new[] { | ||
new PropertyViewModelData(targetClass, propName, typeof(ReflectionClassViewModel)) | ||
}.Concat(inlineData).ToArray(); | ||
|
||
if (symbol) yield return new[] { | ||
new PropertyViewModelData(targetClass, propName, typeof(SymbolClassViewModel)) | ||
}.Concat(inlineData).ToArray(); | ||
} | ||
} | ||
|
||
internal class PropertyViewModelDataAttribute<T> : PropertyViewModelDataAttribute | ||
{ | ||
public PropertyViewModelDataAttribute(string propName, params object[] additionalInlineData) : base(typeof(T), propName, additionalInlineData) | ||
{ | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters