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 964679
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T01:52:08+00:00 2026-05-16T01:52:08+00:00

This is probably a noob question that I will get slated for but here

  • 0

This is probably a noob question that I will get slated for but here goes… Sorry for the length tried to keep it as short as possible.

BackGround

I’m working on tidying up a code base that I inherited in my new role. So I’m introducing tests as I work on sections/Bugs/New Features. One of these features is an invoice printing function the invoice is generated from a crystal report rpt file. There was already a small wrapper for the underlying Crystal functions, I’m just wanting to test it out and make sure we produce the files as required.

Problems
Firstly, I know that anything using file IO should not be part of unit testing but can I cover this with Integration Tests / System tests? Do I just run the wrapper with preloaded data and check it spits a file out? Can I interrogate the PDF programatically and make sure details are correct?

I have also tried to mock out some of the IO so that I could unit test the wrapper but here I have problems with moq not liking the crystal ReportDocument class. Also I had to really change the structure of the Class to allow for testing, should I really be doing this (sort of feel like I should) but making privates public just so I can insert test data seems a bit wrong.

I haven’t posted code as this is more a theoretical debate at the minute… I’d love to get some code coverage but not sure if I’m over thinking things can somebody please advise me on these type of situations.

Thanks ever so much.

  • 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-16T01:52:09+00:00Added an answer on May 16, 2026 at 1:52 am

    I wouldn’t worry about unit testing this class, because its a integration class by nature. The implementation should be fairly simple (just wiring methods to the underlying crystal reports objects etc), so I wouldn’t even bother to have a dedicated integration test for this single class. You should however cover it by acceptance/higher level integration tests. I am not sure how Crystal Reports works, but ideally you would like to compare the pdf in a binary way with a known good version (this will only work if the generated files are always the same).

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

Sidebar

Related Questions

sorry for the (probably) noob question, but I', new at this stuff. i have
I understand that this is a probably a noob-ish question, but I've had no
This is probably a noob question but can't get my head around it. How
I'm sorry for this ( probably very ) noob question, but i've been asked
This is probably a java noob question but here is my scenario: using selenium,
This will probably seem like a noob question but I have managed to intall
sorry this is probably an embarassing noob question for c#, but I came across
I'm a noob so this is probably basic stuff, but I have tried to
Im sorry for this probably dumm question, but I want to simply open modals
This is probably a noob question but I've been trying to figure it out

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.