public class TestResourceNamer extends ResourceNamer
TestMode.PLAYBACK, then names are fetched from
RecordedData. If the test mode is TestMode.RECORD, then the names are randomly generated and
persisted to RecordedData.| Constructor and Description |
|---|
TestResourceNamer(String name,
TestMode testMode,
RecordedData recordedData)
Deprecated.
|
TestResourceNamer(TestContextManager testContextManager,
RecordedData recordedData)
Constructor of TestResourceNamer
|
| Modifier and Type | Method and Description |
|---|---|
OffsetDateTime |
now()
Gets an OffsetDateTime of UTC now.
|
String |
randomName(String prefix,
int maxLen)
Gets a random name.
|
String |
randomUuid()
Gets a random UUID.
|
String |
recordValueFromConfig(String value)
Record the value into recordedData, and pop it up when playback.
|
@Deprecated public TestResourceNamer(String name, TestMode testMode, RecordedData recordedData)
TestResourceNamer.TestResourceNamer(TestContextManager, RecordedData) instead.name - test name as prefixtestMode - The TestMode which the test is running in.recordedData - the recorded data with list of network callpublic TestResourceNamer(TestContextManager testContextManager, RecordedData recordedData)
testContextManager - Contextual information about the test being ran, such as test name, TestMode,
and others.recordedData - the recorded data with list of network callNullPointerException - If testMode isn't TestMode.LIVE, doNotRecord is
false, and recordedData is null.public String randomName(String prefix, int maxLen)
randomName in class ResourceNamerprefix - the prefix to be used if possiblemaxLen - the max length for the random generated namepublic String randomUuid()
randomUuid in class ResourceNamerpublic OffsetDateTime now()
Copyright © 2020 Microsoft Corporation. All rights reserved.