Hi everyone,
Can I programmatically get all methods reference to a class using C#?
Example scenario:
I have class:
public class SearchScreen
{
}
Inner the test case below, I have a calling to that class:
public void Test_Search()
{
var searchScreen = ScreenFactory.GetScreen<SearchScreen >();
}
What I want:
Input: "SearchScreen"
Output: "Test_Search"
The reason why I have this demand because I want to get all test case methods for a specific screen to limit the list of test cases to execute in order to reduce time. There are a thousand test cases in total.
Could you tell me is it possible or any other idea to perform this?
This just gets all method of a class, but I want to get all references method of a class. In your example, I would like to input "Student" and get output "GetMethodsUsingReflection"
This just gets all method of a class, but I want to get all references method of a class. In your example, I would like to input "Student" and get output "GetMethodsUsingReflection"
Oh, you could get all references for a method in a class by using something like Resharper that you can use the full version (free) for 30 days.
None
0 Points
3 Posts
How to programmatically get all methods reference to a class using C#?
Apr 12, 2018 02:25 PM|An Nhien|LINK
Hi everyone,
Can I programmatically get all methods reference to a class using C#?
Example scenario:
I have class:
public class SearchScreen
{
}
Inner the test case below, I have a calling to that class:
public void Test_Search()
{
var searchScreen = ScreenFactory.GetScreen<SearchScreen >();
}
What I want:
Input: "SearchScreen"
Output: "Test_Search"
The reason why I have this demand because I want to get all test case methods for a specific screen to limit the list of test cases to execute in order to reduce time. There are a thousand test cases in total.
Could you tell me is it possible or any other idea to perform this?
Thank you so much!
An Nhien
Contributor
4863 Points
4120 Posts
Re: How to programmatically get all methods reference to a class using C#?
Apr 12, 2018 08:19 PM|DA924|LINK
Can I programmatically get all methods reference to a class using C#?
Your friend Bing or Google can do search on a topic.
https://www.c-sharpcorner.com/blogs/getting-all-methods-of-class-using-reflection-c-sharp1
None
0 Points
3 Posts
Re: How to programmatically get all methods reference to a class using C#?
Apr 13, 2018 02:03 AM|An Nhien|LINK
This just gets all method of a class, but I want to get all references method of a class. In your example, I would like to input "Student" and get output "GetMethodsUsingReflection"
Contributor
4863 Points
4120 Posts
Re: How to programmatically get all methods reference to a class using C#?
Apr 13, 2018 04:25 AM|DA924|LINK
Oh, you could get all references for a method in a class by using something like Resharper that you can use the full version (free) for 30 days.
Find Usages Advanced
https://www.jetbrains.com/resharper/features/navigation_search.html
None
0 Points
3 Posts
Re: How to programmatically get all methods reference to a class using C#?
Apr 15, 2018 01:35 PM|An Nhien|LINK
:( Yes, but I have to programmatically implement it.
Do you have any idea about that?