summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Loader/TestMember.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Xamarin.Forms.Loader/TestMember.cs')
-rw-r--r--Xamarin.Forms.Loader/TestMember.cs43
1 files changed, 43 insertions, 0 deletions
diff --git a/Xamarin.Forms.Loader/TestMember.cs b/Xamarin.Forms.Loader/TestMember.cs
new file mode 100644
index 00000000..95eb0ec9
--- /dev/null
+++ b/Xamarin.Forms.Loader/TestMember.cs
@@ -0,0 +1,43 @@
+´╗┐using System.Collections.Generic;
+using System.Reflection;
+using NUnit.Framework;
+using Xamarin.Forms.CustomAttributes;
+
+namespace Xamarin.Forms.Loader
+{
+ internal sealed class TestMember : ILoaderElement
+ {
+ readonly IEnumerable<CategoryAttribute> categoryAttributes;
+
+ readonly IEnumerable<UiTestAttribute> uiTestAttributes;
+
+ public TestMember(TestType uiTestType, MemberInfo memberInfo)
+ {
+ DeclaringType = uiTestType;
+ MemberInfo = memberInfo;
+
+ // handle public overrides that inherit attributes
+ uiTestAttributes = memberInfo.GetCustomAttributes<UiTestAttribute>();
+ categoryAttributes = memberInfo.GetCustomAttributes<CategoryAttribute>();
+ }
+
+ internal FormsLoader FormsLoader
+ {
+ get { return DeclaringType.FormsLoader; }
+ }
+
+ public TestType DeclaringType { get; }
+
+ public MemberInfo MemberInfo { get; }
+
+ public IEnumerable<UiTestAttribute> UiTestAttributes()
+ {
+ return uiTestAttributes;
+ }
+
+ public IEnumerable<CategoryAttribute> CategoryAttributes()
+ {
+ return categoryAttributes;
+ }
+ }
+} \ No newline at end of file