Forum member

vegar

5 posts

Posts by vegar

  1. MSTest AssemblyInitialize & TestContext

    Visual Studio 2022 nCrunch 4.11 MSTest v2 2.2.7 .net 5 We use a AssemblyInitialize attribute to initialize some global stuff for our tests. In there we are accessing TestContext.TestRunResultsDirectory to store some temporary database files. The problem is that when running our tests t…

  2. disposer on testclass not run

    I've not been able to make the disposer run, but the TestCleanup method started doing its job as soon as I made it public :-) Even parallel test runs want run the same test concurrently? Using the TestContext I can combine the machine name and the test name to get a pretty accurate / safe namespa…

  3. disposer on testclass not run

    The challenge about namespaces is that multiple test runs on multiple machines uses the same hosted mongodb. But pod was a good idea. In combination with machine name it should be a pretty safe strategy I guess - cause all tests run by ncrunch runs by same process? I get 'black dots' on the clea…

  4. disposer on testclass not run

    Thanks! I would still love to understand why it fails to clean up as often as it does under what appears as normal circumstances. But your advice on cleaning up before executing instead of after was interesting. Of cause that means I have to find a different strategy for namespaces. Currently…

  5. disposer on testclass not run

    I have a base class for all my database tests. It will provide the test with namespaced collection (mongo), and delete the collections afterwards. It doesn't seems like the cleanup code is run when ncrunch is running my tests, though. The result is mongodb running out of namespaces. I'm usin…