Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

DependsOn across classes

29 views
Skip to first unread message

wonderbison

unread,
Jun 29, 2012, 6:25:26 AM6/29/12
to mbun...@googlegroups.com
Hi
 
I dont think that DependsOn as a fixture attribute works across classes. I was hoping that the tests would run in the following order, InitialLoadTests, SingleRowCrudTests and then ReconciliationTests. If DependsOn attribute is not the right attribute, is getting the order across test classes possible? Thanks
 
//ReconciliationTests.csh
using MbUnit.Framework;
using My.QA.Framework.Data;
 
namespace My.QA.DataTests.Hds
{
    [TestFixture]
    [DependsOn(typeof(SingleRowCrudTests))]

    class ReconciliationTests
    {
        [Test]
        [Category("Always")]
        [Description("Tun the reconcilliation and confirm that it succeeds")]
        public void RunReconciliationAndConfirmThatItSucceeds()
        {
            // run initial load
            bool jobSuccess = SQLServerAgentJobs.Execute(HdsUtilities.HdsReconcileAgentJob);

            // check job succeeds
            Assert.IsTrue(jobSuccess);
        }

    }
}
//SingleRowCrudTests.cs
using System;
using System.Diagnostics;
using MbUnit.Framework;

namespace My.QA.DataTests.Hds
{
    [TestFixture]
    [DependsOn(typeof(InitialLoadTests))]
    public class SingleRowCrudTests
    {
        [FixtureSetUp]
        [Category("Always")]
        [Description("This is the text fixture setup for all tests")]
        public void FixtureSetup()
        {
            _cdcStagingAgentJobWasDisabled = HdsUtilities.EnableJob(HdsUtilities.CdcStagingAgentJob);
            _hdsAgentJobWasDisabled = HdsUtilities.EnableJob(HdsUtilities.HdsLoadAgentJob);
        }
        [Test]
        public void ReturnTrue()
        {
        }
    }
}
//InitialLoadTests.cs
using MbUnit.Framework;
using My.QA.Framework.Data;
 
namespace My.QA.DataTests.Hds
{
    [TestFixture]
    class InitialLoadTests
    {
        [Test]
        [Category("Always")]
        [Description("Run inital load and confirm that it succeeds")]
        public void RunInitialLoadAndConfirmThatItSucceeds()
        {
        }
    }
}

Graham Hay

unread,
Jun 29, 2012, 7:08:15 AM6/29/12
to mbun...@googlegroups.com
Seems to work alright for me (see attached). Are all the fixtures in the same assembly?

--
You received this message because you are subscribed to the Google Groups "MbUnit.Dev" group.
To view this discussion on the web visit https://groups.google.com/d/msg/mbunitdev/-/KFyKJM9zkNgJ.
To post to this group, send email to mbun...@googlegroups.com.
To unsubscribe from this group, send email to mbunitdev+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mbunitdev?hl=en.

WithDependsOn.html
Reply all
Reply to author
Forward
0 new messages