FixtureSetUp trouble ?!

21 views
Skip to first unread message

Kris-I

unread,
Nov 25, 2008, 8:15:25 AM11/25/08
to galli...@googlegroups.com
Hello,

I use VS2008SP1 with SQLServer2008 installed on this PC with an Windows XP SP3.

I use TestDriven the latest beta (TestDriven.NET-2.17.2240) but I have the same trouble with the beta 2.16 and the latest stable.

I use "Gallio v3.0.5 build 546 - x86" and MbUnit V3

When I run the test below, the variable _provider is all the time null. When I copy the FixtureSetUp content in the test method no problem.

The FixtureSetUp is never executed.

Yesterday, at home, I had exactly the same problem, same software config but on Windows Vista SP1 64bits

I don't know how, after installation, remove, installation again , ..... that's work now, but I think it's not normal.

I installed in this order :
- Testdriven
- Gallio

At home I installed :
- MbUnit v2
- TestDriven
- Gallio
>>> same problem


namespace DAL.Test
{
    [TestFixture]
    public class Tests
    {
        private DAL.NHProvider _provider;

        [Test]
        public void CanGestCustomerByFirstName_BE()
        {
            Customer customerTest = new Customer();
            customerTest.FirstName = "Orlando";
            Assert.AreEqual(2, _provider.GetCustomerByFirstName_BE(customerTest).Count);
        }

        [FixtureSetUp]
        public void InitializeAllTests()
        {
           _provider = new DAL.NHProvider();
        }
    }
}

Kris-I

unread,
Nov 25, 2008, 2:09:00 PM11/25/08
to galli...@googlegroups.com
Am I the first to have this trouble (on 2 PCs) ?

Thanks,

Jeff Brown

unread,
Nov 25, 2008, 2:20:12 PM11/25/08
to galli...@googlegroups.com
So it works now?
We have tests for FixtureSetUp and a lot of tests that depend on that behavior so it's probably working fine.
 
That said, I wonder if there was an issue compiling the code.
 
This might sound rather silly, but sometimes TestDriven.Net will fail to automatically build the test assembly before running it.  The result is that you can end up running old code.  Alternately, it can happen that some old referenced assembly is not getting replaced (typical case is when the "Specific Version" flag is set or if there's some ambiguity).  Then all sorts of weird things happen.
 
Jeff.


From: galli...@googlegroups.com [mailto:galli...@googlegroups.com] On Behalf Of Kris-I
Sent: Tuesday, November 25, 2008 5:15 AM
To: galli...@googlegroups.com
Subject: FixtureSetUp trouble ?!

Kris-I

unread,
Nov 25, 2008, 2:26:46 PM11/25/08
to galli...@googlegroups.com
At home yes, at work no.... the same code, the same project but one is on XP SP3 and the other on Vista SP1 64 bits

At home yes but I don't know what's happen because after installation of TestDriven and Gallio I hade the same problem and after remove, install, remove.... that's work now

Strange,

So it works now?


Kris-I

unread,
Nov 27, 2008, 1:49:49 AM11/27/08
to galli...@googlegroups.com
My code yesterday was working and committed on VisualSVN

At job, I remove all my project and get the project from VisualSVN, I compile ok but the tests failed. Then I removed TestDriven.NET and Gallio. I reinstall them BUT in the default folder in "C:\Program Files" before it was on "D:\Program Files", I get the project again, compile and test .... all passed.

At home on Vista 64 bit the default directory to install is "C:\Program Files (x86)\ ....

May be a lead ?

Regards,
Reply all
Reply to author
Forward
0 new messages