System.IO.FileCleanupTestBase.GetTestFileName C# (CSharp) Méthode

GetTestFileName() protected méthode

Gets a test file name that is associated with the call site.
protected GetTestFileName ( int index = null, [ memberName = null, [ lineNumber ) : string
index int An optional index value to use as a suffix on the file name. Typically a loop index.
memberName [ The member name of the function calling this method.
lineNumber [ The line number of the function calling this method.
Résultat string
        protected string GetTestFileName(int? index = null, [CallerMemberName] string memberName = null, [CallerLineNumber] int lineNumber = 0)
        {
            return string.Format(
                index.HasValue ? "{0}_{1}_{2}" : "{0}_{1}",
                memberName ?? "TestBase", lineNumber, index.GetValueOrDefault());
        }
    }