File tree Expand file tree Collapse file tree 1 file changed +4
-14
lines changed
UITests/UITests.Tests.Shared Expand file tree Collapse file tree 1 file changed +4
-14
lines changed Original file line number Diff line number Diff line change @@ -104,22 +104,12 @@ public async Task TestInitialize()
104
104
var theClassName = TestContext . FullyQualifiedTestClassName ;
105
105
#endif
106
106
var currentlyRunningClassType = AppDomain . CurrentDomain . GetAssemblies ( ) . SelectMany ( a => a . GetTypes ( ) ) . FirstOrDefault ( f => f . FullName == theClassName ) ;
107
- if ( ! ( Type . GetType ( theClassName ) is Type type ) )
108
- {
109
- Verify . Fail ( "Type is null. TestClassName : " + theClassName ) ;
110
- return ;
111
- }
112
-
113
- if ( ! ( type . GetMethod ( testName ) is MethodInfo method ) )
114
- {
115
- Verify . Fail ( "Mothod is null. TestClassName : " + theClassName + " Testname: " + testName ) ;
116
- return ;
117
- }
118
107
119
- if ( ! ( method . GetCustomAttribute ( typeof ( TestPageAttribute ) , true ) is TestPageAttribute attribute ) )
108
+ if ( ! ( Type . GetType ( theClassName ) is Type type
109
+ && type . GetMethod ( testName ) is MethodInfo method
110
+ && method . GetCustomAttribute ( typeof ( TestPageAttribute ) , true ) is TestPageAttribute attribute ) )
120
111
{
121
- Verify . Fail ( "Attribute is null. TestClassName : " + theClassName ) ;
122
- return ;
112
+ throw new Exception ( "Could not find " + nameof ( TestPageAttribute ) + " on test method." ) ;
123
113
}
124
114
125
115
var pageName = attribute . XamlFile ;
You can’t perform that action at this time.
0 commit comments