May be this is a stupid question but: I wonder if there is something like default parameter but not by value - but by name.
Example:
I must use a parameter "IWebDriver driver" in a lot of my methods. And I know that always when I use it I will use the name "driver" - the "object" behind the name can be different(IE, FF, Chrome..) but the name will always be the same.
So is this possible to have a function
public void CheckName(string nameToCheck, string expectedValue, IWebDriver driver = driver with name "driver")
{
some code....
}
And when I use it NOT to do:
CheckName("MyName", "MyName", driver)
but to do:
CheckName("MyName", "MyName")
... and the method knows that must get the object with name(string) "driver".
If I want to use other name than default just to specify it:
CheckName("MyName", "MyName", driverOtherName)