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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T19:55:15+00:00 2026-06-08T19:55:15+00:00

I am working on a unit testing for a function in a form call

  • 0

I am working on a unit testing for a function in a form call Tester.cs, below is the error:

Error   7/31/2012 10:43:11 PM   One of the background threads threw exception: 
System.TypeInitializationException: The type initializer for 'Tester.Tester' threw an exception. ---> System.ArgumentNullException: Value cannot be null.
Parameter name: String
   at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
   at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
   at System.Int32.Parse(String s)
   at Tester.Tester..cctor() in E:\Incubator\Tester\Tester\Tester.cs:line 35
   --- End of inner exception stack trace ---
   at Tester.Tester.Dispose(Boolean disposing)
   at System.ComponentModel.Component.Finalize()    MY-PC

On line 35 is a code, which basically retrieve value from configuration file and convert it to integer:

private static int _part = int.Parse(ConfigurationManager.AppSettings["Part"]);

What is the error? Thank you.

  • 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-06-08T19:55:17+00:00Added an answer on June 8, 2026 at 7:55 pm

    The likelyhood is that ConfigurationManager.AppSettings["Part"] is returning null. Hense the parse exception.

    Does your unit test project have the app setting defined in its configuration?

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

Sidebar

Related Questions

I am working with a unit-testing suite that hijacks function calls and tests expected
I am working with Silverlight Unit Testing i need to test a function which
I am working on unit testing and I have to pass context of one
I'm working on a laboratory practical with unit-testing, and below is a piece of
I've been trying to get started with unit-testing while working on a little cli
I'm working on my first project in which I'm utilizing PHPUnit for unit testing.
Am doing a bit of unit testing on a function which attempts to open
I'm writing a module with mixin templates to supply a main function for unit-testing
I'm using jQuery 1.5 and Q-Unit to do my testing. The application I'm working
I'm running into an issue while unit-testing a Python project that I'm working on

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.