Inedo Community Forums Forums
    • Recent
    • Tags
    • Popular
    • Login

    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

    Scheduled Pinned Locked Moved Support
    buildmaster
    5 Posts 1 Posters 0 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ? This user is from outside of this forum
      Guest
      last edited by

      Have you got any good examples for unit testing extentions?

      Are MockActionExecutionContext and UnitTestActionBase of any use?

      Product: BuildMaster
      Version: 4.6.4

      1 Reply Last reply Reply Quote 0
      • ? This user is from outside of this forum
        Guest
        last edited by

        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.

        1 Reply Last reply Reply Quote 0
        • ? This user is from outside of this forum
          Guest
          last edited by

          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

          1 Reply Last reply Reply Quote 0
          • ? This user is from outside of this forum
            Guest
            last edited by

            Is there any way to inject a connect string into the StoredProcs object to help debugging during extension development?

            1 Reply Last reply Reply Quote 0
            • ? This user is from outside of this forum
              Guest
              last edited by

              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.

              1 Reply Last reply Reply Quote 0

              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

              With your input, this post could be even better 💗

              Register Login
              • 1 / 1
              • First post
                Last post
              Inedo Website Home • Support Home • Code of Conduct • Forums Guide • Documentation