hubFS: THE place for F#

. . . are you on The Hub?
Welcome to hubFS: THE place for F# Sign in | Join | Help
in Search

xUnit tests not seen by test runner?

Last post 05-22-2008, 23:26 by cmiles. 5 replies.
Sort Posts: Previous Next
  •  05-16-2008, 8:28 5924

    xUnit tests not seen by test runner?

    I am using xUnit 1.0 and F# 1.9.4.15. After referencing the xUnit dll and opening the namespace I added several tests with the [<Fact>] attribute to my project (all simple Assert.Equal), built a dll and then ran the xunit console runner on the dll - but the console runner did not find any tests? I also tried running tests via TDD.NET in Visual Studio but that also failed to find any tests.

    For troubleshooting I set up a project in C# with the same xUnit dll referenced, wrote a quick test and ran it no problem from both the xunit console runner and TDD.NET. I am new to F# so I suspected that my code might be the problem - so I also set up and built a dll with the code here:

    http://weblogs.asp.net/podwysocki/archive/2008/04/04/relooking-at-xunit-net-rc2.aspx

    but I had the same result - neither the console runner or TDD.NET saw any tests in the code.

    Has anyone else had this problem or recognize what I am doing that is causing the tests not to be seen by the test runner? I am fairly new to F# so maybe something really simple?

    Any help appreciated!

    Charles Miles

  •  05-16-2008, 11:07 5926 in reply to 5924

    Re: xUnit tests not seen by test runner?

    Hi, same thing for me.
    Though I read that now xUnit were able to see static methods
  •  05-16-2008, 12:12 5928 in reply to 5926

    Re: xUnit tests not seen by test runner?

    Thanks for that information Julien - I posted a message on the xUnit discussion and am about to post a simple case to see if they can reproduce the problem (or tell me what I am doing wrong!). Charles Miles
  •  05-17-2008, 10:32 5946 in reply to 5928

    Re: xUnit tests not seen by test runner?

    I posted about my problem over on the Codeplex/xUnit discussions - http://www.codeplex.com/xunit/Thread/View.aspx?ThreadId=27866 - with a few examples and the core of Brad Wilson's reply was: The problem appears to be that the F# class that is created is marked as abstract in the CLR, which causes this to skip over the class Anyone have any suggestions for me if there might be a compilation or syntax options that I am missing/not understanding? Thanks, Charles Miles
  •  05-18-2008, 0:30 5948 in reply to 5946

    Re: xUnit tests not seen by test runner?

    Another update - this is now filed as a bug/issue with the xUnit.net project: http://www.codeplex.com/xunit/WorkItem/View.aspx?WorkItemId=4802 Charles Miles
  •  05-22-2008, 23:26 5989 in reply to 5948

    Re: xUnit tests not seen by test runner?

    Another update - the xUnit team made code changes that make it possible to use the testing style from the first post above. There is not a release yet with the code changes are is the current checkout. Charles
View as RSS news feed in XML
Powered by Community Server, by Telligent Systems