Loading ...
Sorry, an error occurred while loading the content.

test parameters

Expand Messages
  • Alex Pukinskis
    I was wondering whether anyone had an elegant solution that would automatically instruct NUnit to use different configuration settings for testing purposes.
    Message 1 of 3 , Aug 1, 2003
    • 0 Attachment
      I was wondering whether anyone had an elegant solution that would
      automatically instruct NUnit to use different configuration settings
      for testing purposes. We're developing a C#.NET web application that
      has a number of database tests, and we've found that we'd like to use
      two databases per machine during development - one that's hooked up to
      the application when we're using it with the GUI, and another to be
      called when running NUnit.

      We're having trouble coming up with a way to do this without writing a
      lot of additional code, and thought somebody might have a simple
      solution.

      -Alex
    • Alan Flaherty
      Copy the web.config file into the bin directory and rename it to: *DLL-Name*.dll.config Put the database connection string for the testing db in this file and
      Message 2 of 3 , Aug 1, 2003
      • 0 Attachment
        Copy the web.config file into the bin directory and rename it to:

        *DLL-Name*.dll.config

        Put the database connection string for the testing db in this file and
        leave the "live" string in the web.config. When nunit loads the dll for
        running tests it looks for a config file in the same directory called
        *DLL-Name*.dll.config

        Quite useful but some people are saying that you should not be doing
        this as it is an external reliance that is not set in the code, and
        therefore un-compliant to tdd-xp. Another way of doing it is to make a
        custom Settings class that can either be passed values, for testing. But
        in a live situation it reads the web.config file. Though these same
        people would probably be horrified at the thought of running tests on an
        actual db..

        On the same note, there is a C# port of a very lightweight java db,
        Hydra I think its called, going under the name of CSharpSql. I've been
        wondering if this could be used on projects where the database code is
        pretty basic... no cursors or MS SQL specific code. It would run the
        tests in a fraction of the time that it would take to run the tests on a
        live SQL Server and then for final acceptance tests you could switch
        over to a live server to confirm the tests.


        HTH

        Alan

        -----Original Message-----
        From: Alex Pukinskis [mailto:alex@...]
        Sent: 01 August 2003 17:05
        To: extremeprogramming@yahoogroups.com
        Subject: [XP] test parameters

        I was wondering whether anyone had an elegant solution that would
        automatically instruct NUnit to use different configuration settings
        for testing purposes. We're developing a C#.NET web application that
        has a number of database tests, and we've found that we'd like to use
        two databases per machine during development - one that's hooked up to
        the application when we're using it with the GUI, and another to be
        called when running NUnit.

        We're having trouble coming up with a way to do this without writing a
        lot of additional code, and thought somebody might have a simple
        solution.

        -Alex


        To Post a message, send it to: extremeprogramming@...

        To Unsubscribe, send a blank message to:
        extremeprogramming-unsubscribe@...

        ad-free courtesy of objectmentor.com

        Your use of Yahoo! Groups is subject to
        http://docs.yahoo.com/info/terms/
      • Alex Pukinskis
        This works great! Thanks. -Alex
        Message 3 of 3 , Aug 1, 2003
        • 0 Attachment
          This works great! Thanks.

          -Alex

          On Friday, August 1, 2003, at 10:55 AM, Alan Flaherty wrote:

          > Copy the web.config file into the bin directory and rename it to:
          >
          > *DLL-Name*.dll.config
          >
          > Put the database connection string for the testing db in this file and
          > leave the "live" string in the web.config. When nunit loads the dll for
          > running tests it looks for a config file in the same directory called
          > *DLL-Name*.dll.config
          >
          > Quite useful but some people are saying that you should not be doing
          > this as it is an external reliance that is not set in the code, and
          > therefore un-compliant to tdd-xp.
          > Another way of doing it is to make a
          > custom Settings class that can either be passed values, for testing.
          > But
          > in a live situation it reads the web.config file. Though these same
          > people would probably be horrified at the thought of running tests on
          > an
          > actual db..
          >
          > On the same note, there is a C# port of a very lightweight java db,
          > Hydra I think its called, going under the name of CSharpSql. I've been
          > wondering if this could be used on projects where the database code is
          > pretty basic... no cursors or MS SQL specific code. It would run the
          > tests in a fraction of the time that it would take to run the tests on
          > a
          > live SQL Server and then for final acceptance tests you could switch
          > over to a live server to confirm the tests.
          >
          >
          > HTH
          >
          > Alan
          >
          > -----Original Message-----
          > From: Alex Pukinskis [mailto:alex@...]
          > Sent: 01 August 2003 17:05
          > To: extremeprogramming@yahoogroups.com
          > Subject: [XP] test parameters
          >
          > I was wondering whether anyone had an elegant solution that would
          > automatically instruct NUnit to use different configuration settings
          > for testing purposes. We're developing a C#.NET web application that
          > has a number of database tests, and we've found that we'd like to use
          > two databases per machine during development - one that's hooked up to
          > the application when we're using it with the GUI, and another to be
          > called when running NUnit.
          >
          > We're having trouble coming up with a way to do this without writing a
          > lot of additional code, and thought somebody might have a simple
          > solution.
          >
          > -Alex
          >
          >
          > To Post a message, send it to: extremeprogramming@...
          >
          > To Unsubscribe, send a blank message to:
          > extremeprogramming-unsubscribe@...
          >
          > ad-free courtesy of objectmentor.com
          >
          > Your use of Yahoo! Groups is subject to
          > http://docs.yahoo.com/info/terms/
          >
          >
          > To Post a message, send it to: extremeprogramming@...
          >
          > To Unsubscribe, send a blank message to:
          > extremeprogramming-unsubscribe@...
          >
          > ad-free courtesy of objectmentor.com
          >
          > Your use of Yahoo! Groups is subject to
          > http://docs.yahoo.com/info/terms/
          >
        Your message has been successfully submitted and would be delivered to recipients shortly.