-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Associativity tests, slight refactoring and formatting fixes.
- Loading branch information
Showing
18 changed files
with
985 additions
and
769 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
25 changes: 0 additions & 25 deletions
25
src/ExpressiveAnnotations.MvcWebSample.UITests/AttributesCompilationTest.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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Reflection; | ||
using ExpressiveAnnotations.Attributes; | ||
|
||
namespace ExpressiveAnnotations.MvcWebSample.UITests | ||
{ | ||
public static class Helper | ||
{ | ||
public static IEnumerable<ExpressiveAttribute> CompileExpressiveAttributes(this Assembly assembly) | ||
{ | ||
return assembly.GetTypes().SelectMany(CompileExpressiveAttributes); | ||
} | ||
|
||
public static IEnumerable<ExpressiveAttribute> CompileExpressiveAttributes(this Type type) | ||
{ | ||
var properties = type.GetProperties() | ||
.Where(p => Attribute.IsDefined(p, typeof (ExpressiveAttribute))); | ||
|
||
var attributes = new List<ExpressiveAttribute>(); | ||
foreach (var prop in properties) | ||
{ | ||
var attribs = prop.GetCustomAttributes<ExpressiveAttribute>().ToList(); | ||
attribs.ForEach(x => x.Compile(prop.DeclaringType)); | ||
attributes.AddRange(attribs); | ||
} | ||
return attributes; | ||
} | ||
} | ||
} |
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
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
Oops, something went wrong.