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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T01:57:00+00:00 2026-05-22T01:57:00+00:00

I have a function which will take student details as input and write their

  • 0

I have a function which will take student details as input and write their report card into a xml file. When i tried to create unit tests in vs2008 i saw the message – “A method that does not return a value cannot be verified.” My function does not return a value it merely writes into a file and returns.

How do i write tests for this function?

[TestMethod()]
public void StoreInformationTest()
{
   StudentSettings target = new StudentSettings(); // TODO: Initialize to an appropriate   
   StudentSettings settings = null; // TODO: Initialize to an appropriate value
   target.StoreInformation(settings);
   Assert.Inconclusive("A method that does not return a value cannot be verified.");
}

Thanks in advance,

Regards,
John

  • 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-22T01:57:01+00:00Added an answer on May 22, 2026 at 1:57 am

    With good separation of responsibilities, it would be easy to replace your file with something like a memorystream. Write into a memory stream instead of a file. Then you can test against the content of that. But as mentioned by others, a code example would maybe reveal other needs.

    UPDATE:
    Thanks for the code. It looks like your StudentSettings class is doing too much. Separate XML-writing functions into their own class, extract an interface from it, and inject this into your class as a constructor argument. Then you can replace it with your own mock during tests.

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

Sidebar

Related Questions

I have to develope a function which will take string (xml string) as input
I have a Function in CFC file, which will be called from .cfm file
I have one template function which will take a pointer type and i have
I want to write a function validate() which will take some pattern or regular
I have a function that will take a range of values, which need to
I'm trying to write a bash function which will take all the arguments sent
I have a function which parses one string into two strings. In C# I
I have a function which returns a one-sided intersection of values between two input
Currently I have a function which can take the start time and end time
I have a function where I will compress a bunch of files into a

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.