So I have a function like this that will call other function and pass in a string that will be returned based on different condition. They will always use a normal string, however if certain conditions are met then the special string will be used to passed in to the other function instead.
public async Task Func(context)
{
var stringToBeUsed = GetNormalString(context);
if (FirstConditionFulfilled(context) &&
(SecondConditionFulfilled(context))
{
stringToBeUsed = GetSpecialString(context);
}
await DoSthElse(context, stringToBeUsed );
}
This is the get normal string function
private string GetNormalString(context)
=> context.HttpContext.DoSthToGetNormalString().ToString();
And this is the get special string function
private string GetSpecialString(context)
=> context.HttpContext.DoSthToGetSpecialString().ToString;
I wonder how should I set up the unit test to see if certain conditions are met, the stringToBeUsed will be the special string, otherwise, will be the normal string?