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()
104104 var theClassName = TestContext . FullyQualifiedTestClassName ;
105105#endif
106106 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- }
118107
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 ) )
120111 {
121- Verify . Fail ( "Attribute is null. TestClassName : " + theClassName ) ;
122- return ;
112+ throw new Exception ( "Could not find " + nameof ( TestPageAttribute ) + " on test method." ) ;
123113 }
124114
125115 var pageName = attribute . XamlFile ;
You can’t perform that action at this time.
0 commit comments