Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding support for GenerateId max length #11659

Merged
merged 1 commit into from
Apr 29, 2020
Merged

Conversation

vinagesh
Copy link
Member

… testframework

@pakrym
Copy link
Contributor

pakrym commented Apr 29, 2020

Is the goal here to limit the final ID length?

What about the following signature

stirng GenerateId(string prefix, int maxLenght)

?

@vinagesh
Copy link
Member Author

@pakrym - You suggestion on the signature looks good too. But that means there needs to be logic about calculating the length of the prefix and then determining the random number range in the test framework. Do you want to go that route? Also I see the gates are failing. Do you have any idea why?

@pakrym
Copy link
Contributor

pakrym commented Apr 29, 2020

@pakrym - You suggestion on the signature looks good too. But that means there needs to be logic about calculating the length of the prefix and then determining the random number range in the test framework. Do you want to go that route?

you can make in simpler and do (prefix + Random.Next()).Substing(maxLenght)

Also I see the gates are failing. Do you have any idea why?

Trailing whitespace somewhere.

SA1028: Code should not contain trailing whitespace

@vinagesh
Copy link
Member Author

@pakrym - Unfortunately I don't get the option to reply to your conversations here so making a new comment each time. I like your idea and I will change the code and update the PR. I currently have the .substring in my code. Makes sense to just move the logic to the test framework.

@vinagesh vinagesh changed the title Adding support for min and max values for random number generation in… Adding support for GenerateId max length Apr 29, 2020
@pakrym pakrym merged commit 254cd17 into master Apr 29, 2020
@pakrym pakrym deleted the vinagesh/addRandomMax branch April 29, 2020 20:08
openapi-sdkautomation bot pushed a commit to AzureSDKAutomation/azure-sdk-for-net that referenced this pull request Nov 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants