C
C#2y ago
Simo

passing license keys to a unit test

I would like to use a 3rd party DLL which needs a license key passed in, however I cannot find a way to do this, as the unit test project seems to ignore launchSettings.json, and I don't want to hard-code the key anywhere in the test itself. on Live this comes from an environment variable
7 Replies
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Simo
Simo2y ago
a PDF library which needs me to explicity call something like setLicence(keyHere) it's for an integration test i suppose, technically, as it is the first step to producing a secondary list of things
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Simo
Simo2y ago
i feed it a PDF, it produces a thing, then I do stuff with that thing appsettings does work, ill just have to be careful to add those ones to gitignore
Cisien
Cisien2y ago
Check out UserSecrets It gives you a config file stored in your profile, basically
Simo
Simo2y ago
actually that's what im using elsewhere for another project, can check in blank values for the appsettings then 👌 (just to let other devs know theyre needed)
Mayor McCheese
If you're using user secrets, user secrets is driven by the id, so for instance two projects can use the same id; user secrets also have nothing to do with your code, so you can share them across multiple solutions as well if it makes sense to do so.
Want results from more Discord servers?
Add your server
More Posts