Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5844779
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:20:28+00:00 2026-05-22T12:20:28+00:00

I have the following IntegrationTest project structure … If i wish to use that

  • 0

I have the following IntegrationTest project structure …

enter image description here

If i wish to use that test data 126.txt in an NUnit Test, how do I load that plain txt file data?

NOTE: The file is -linked- and I’m using c# (as noted by the image).

cheers 🙂

  • 1 1 Answer
  • 5 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T12:20:29+00:00Added an answer on May 22, 2026 at 12:20 pm

    You could specify in the properties of the file to be copied to the output folder and inside the unit test:

    string text = File.ReadAllText(Path.Combine(TestContext.CurrentContext.TestDirectory, "TestData", "126.txt"));
    

    As an alternative you could embed this file as a resource into the test assembly and then:

    var assembly = Assembly.GetExecutingAssembly();
    using (var stream = assembly.GetManifestResourceStream("ProjectName.Tests.IntegrationTests.TestData.126.txt"))
    using (var reader = new StreamReader(stream))
    {
        string text = reader.ReadToEnd();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written an integrationtest that fails: [Test] public void Find_WorkItemWithMatchingDescriptionExistsInRepository_ReturnsWorkItem() { // arrange
I have following script that executes all the .reg files in the current directory.
I have a .gitignore file in my project directory and I placed the following
I have a integration test which does the following: @ContextConfiguration( locations={..path to xmls..} )
Please, help me understand the following. I have an spring integration test, which I'm
I have created an integration test of a service that is not rolling back
i have following problem To decode the Biquinary code use the number 5043210. At
Given a select control that you wish to have the applicable option selected upon
have following directory structure src/com src/META-INF/MANIFEST.MF src/META-INF/spring src/META-INF/spring/context.xml now when i run the script,
Have following Java code,that creates StringBuilder with \n,i.e. carriage return delimiters: while (scanner.hasNextLine()){ sb.append(scanner.nextLine()).append(\n);

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.