Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.
If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!
UnitTesting Extensions
-
Have you got any good examples for unit testing extentions?
Are MockActionExecutionContext and UnitTestActionBase of any use?
Product: BuildMaster
Version: 4.6.4
-
Ignore MockActionExecutionContext - its something I was playing around with some time ago.
Essentially I am developing an extension that extens off ActionBase and would like to write a unit test to call the Execute method, which in turn is calling the StoredProcs api, and be able to debug through my code, happy for it to be running against live BuildMaster instance.
I have seen this: http://inedo.com/support/tutorials/debugging-buildmaster-extensions, but that seems to require deploying the extension before you can debug/test your code.
-
Extensible Actions themselves are not particularly Unit Test friendly (since the only method of any use really is the
Execute()
method, and it mostly relies on integration with third-party components and tools anyway). However, there are a few extensions that have some basic integration tests on GitHub if it helps any:https://github.com/Inedo/bmx-artifactory/blob/master/Artifactory.Tests/DeployArtifactTest.cs
https://github.com/Inedo/bmx-azure/blob/master/Azure.Tests/AzureActionTests.cs
-
Is there any way to inject a connect string into the StoredProcs object to help debugging during extension development?
-
As currently written, I can't think of a good way to inject a connection string since that's handled at a higher level. I suppose the best way is to test against a local copy of BuildMaster with the connection string you want.