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

  • SEARCH
  • Home
  • 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 7501099
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T20:25:36+00:00 2026-05-29T20:25:36+00:00

Technology Stack: .NET 4, C#, NUnit I am attempting to apply test driven development

  • 0

Technology Stack: .NET 4, C#, NUnit

I am attempting to apply test driven development to a new project that performs image processing. I have a base class that contains shared file I/O methods and subclasses that perform various specific processing algorithms. As I understand it, unit tests do not touch the file system or other objects, and mock behavior where that occurs. My base class only contains simple accessors and straightforward file system I/O calls.

public class BaseFile
{
    public String Path { get; set; }

    public BaseFile()
    {
        Path = String.Empty;
    }

    public BaseFile(String path)
    {
        if (!File.Exists(path))
        {
            throw new FileNotFoundException("File not found.", path);
        }

        Path = path;
    }
}

Is there any value in testing these methods? If so, how could I abstract away the calls to the file system?

My other question is how to test the subclass which is specific to a type of image file (~200 MB). I have searched the site and found similar questions, but none dealing with the file sizes I am working with on this project. Is it plausible for a class to have integration tests (using a “golden file”), but no unit tests? How could I strictly follow TDD methods and first write a failing test in this case?

  • 1 1 Answer
  • 0 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-29T20:25:42+00:00Added an answer on May 29, 2026 at 8:25 pm

    In answer to your first question, yes there is value in testing these methods. I have published a library that facilitates doing exactly that without actually hitting the file system: https://bitbucket.org/mylesmcdonnell/mpm.io/wiki/Home

    In (not an) answer to your second question I would need to see some code, but I suspect you may need to take a similar approach to the above lib. namely; define interface, define proxy to concrete, define factory to return proxy or mock.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Well the problem is that I am new to asp.net technology and I am
i have a problem in MVC ASP.NET project. i work with LINQ technology.When i
I am new to the Microsoft Technology Stack. I happened to take a superficial
Which technology stack is best for the creation of a two dimensional MMORPG and
I've been evaluating technology stack for developing a social network based application. Below are
LAMP is a well-known acronym for the software/technology bundle/stack representing Linux , Apache ,
Technology Used:- Asp.Net 2.0 Code:- See Below Description:- hello code given below is working
Each technology is powerful with libraries and frameworks, written for it. I understand, that
JavaFX is a new technology introduced by Sun. I would like to know what
Let's say I asked Microsoft to describe the perfect, modern, Microsoft-based technology stack to

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.