Skip to content

Commit

Permalink
Adding support for GenerateId max length (#11659)
Browse files Browse the repository at this point in the history
  • Loading branch information
vinagesh authored Apr 29, 2020
1 parent 8b31ec0 commit 254cd17
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sdk/core/Azure.Core/tests/TestFramework/TestRecording.cs
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,11 @@ public string GenerateId()
return Random.Next().ToString();
}

public string GenerateId(string prefix, int maxLength)
{
return $"{prefix}{Random.Next()}".Substring(0, maxLength);
}

public string GenerateAssetName(string prefix, [CallerMemberName]string callerMethodName = "testframework_failed")
{
if (Mode == RecordedTestMode.Playback && IsTrack1SessionRecord())
Expand Down

0 comments on commit 254cd17

Please sign in to comment.