Any idea why a unit test class is not discovered in the server project.

Locked Any idea why a unit test class is not discovered in the server project.

  • Saturday, November 17, 2012 11:02 AM
     
     

    I'm quite familiar with unit testing in regular .net projects. 

    It's fairly simple to add to a lightswitch solution a new project and add e.g. Xunit test classes. Works like a charm.

    But when I want to add a xUnit test class (after using nuget to install Xunit in the assembly), everything compiles fine, but tests are not discovered.

    Any idea how to fix this ?


    paul van bladel

All Replies

  • Wednesday, November 21, 2012 6:37 AM
     
     
    no idea??

    paul van bladel

  • Monday, November 26, 2012 5:28 PM
     
     Answered

    Hello Paul

    With this release as with our first release (see comments regarding V1 from http://social.msdn.microsoft.com/Forums/en-US/lightswitchgeneral/thread/16d40b45-5ede-4c94-a71e-242b65c274c1) , believe we still have not yet addressed this.  I will bring this up for v-next to see if we can get this worked included as I can see that there more than a few folks wanting this!  Thanks for bringing this up!

    -Robert 

  • Monday, November 26, 2012 6:06 PM
     
     

    Thanks Robert,

    Would be great. 

    Check also following post: http://social.msdn.microsoft.com/Forums/en-US/lightswitchhtml/thread/f50cc506-664b-40ce-b9ef-688ec19b4461

    which addresses the question how to access the ServerApp Context in an assembly where there is no http context.

    I think that being able to write full-blown unit tests in LightSwitch will be a huge step forward to convince professional IT people to adopt LightSwitch.

    In modern programming practice, unit tests is seen as a must because it:

    (1) improves the general code design because you first think about how testing the code and build up your code step by step

    (2) acts as a safety net for changes into your codes base. (especially when running the tests in continuous integration)

    This makes sense in LightSwitch as well.

    In standard N-tier .net development, unit tests are most frequently used for testing the "business logic layer" in isolation (where the data layer is mocked out) or with a "connected" data layer (so more an integration test scenario)

    I have not yet a clear idea how to architecture this in LightSwitch. Ideas are welcome.


    paul van bladel

  • Monday, November 26, 2012 6:31 PM
     
     

    Cool - thanks for the additional info! 

    Will see if we can provide some "guidance" on what can be done here in the current release of LightSwitch.

    -Robert