Passing connectin string dynamically to Nunit

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • honavar
    New Member
    • Oct 2007
    • 5

    Passing connectin string dynamically to Nunit

    Hi all,

    I have written Nunit test case using C#. I am using same database located in different server for example server1 and server2.

    My config file is

    <configuratio n>

    <appSettings>


    <add key="x" value="server1"/>

    </appSettings>

    </configuration

    when i execute the test case then it will execute with server1

    Now the question is:
    I want to execute the same test case with server2

    How can i pass connection string of server2 to test case dynamically or run time

    please help me

    Reagrds
    Prashant
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    Question moved to .NET Forum.

    Comment

    • honavar
      New Member
      • Oct 2007
      • 5

      #3
      Passing parameters to nunit at runtime

      Hi all,

      I have written Nunit test case using C#. I am using same database located in different server for example server1 and server2.

      My config file is

      <configuratio n>

      <appSettings>


      <add key="x" value="server1"/>

      </appSettings>

      </configuration

      when i execute the test case then it will execute with server1

      Now the question is:
      I want to execute the same test case with server2

      How can i pass connection string of server2 to test case dynamically or run time

      please help me

      Reagrds
      Prashant

      Comment

      • kenobewan
        Recognized Expert Specialist
        • Dec 2006
        • 4871

        #4
        You need to use the configuration appsettings to read these values to place in your connection string.

        Please do not double post, the two threads have been merged.

        MODERATOR

        Comment

        • honavar
          New Member
          • Oct 2007
          • 5

          #5
          Hi Thanks for you reply

          If u have any sample please give it to me I am new to Nunit...

          Please explani me clearly how should i proceed with this problem..

          regards
          Prashant


          Originally posted by kenobewan
          You need to use the configuration appsettings to read these values to place in your connection string.

          Please do not double post, the two threads have been merged.

          MODERATOR

          Comment

          Working...