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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:58:10+00:00 2026-05-27T05:58:10+00:00

I am using NUnit with Visual Studio Express Edition 2010 for C#, Now, normally

  • 0

I am using NUnit with Visual Studio Express Edition 2010 for C#, Now, normally test works fine. But whenever I try to use Massive.cs, which is open source api to access database. Test fails from that file only. Now, if I run the application, api is working fine. I have created a different library file to access data base.

I seriously don’t understand the error. It is just giving error that object reference is not set to an object. But if I run the code, it works fine. I am using dynamic keyword as shown in link of api above. Does that making problem with NUnit ?

Is there any other way to test in this type of Scenarios?

Here are the further details of the code,

Test class is like this

dynamic item = new Item();
item.Insert(new { Name = "Maggi", Description = "Its 2 Min Nuddles", IsDelete = false });

var items = item.All();

Assert.AreEqual("Maggi", items.FirstOrDefault().Name);

Now, I have put test here. Which gives error like shown in image,
Error coming while testing with NUnit

Now if I run code in console application, then code is working fine, code snippet is given below

dynamic item = new Item();
        item.Insert(new { Name = "Maggi", Description = "Its 2 Min Nuddles", IsDelete = false });


        var result = item.All();

        foreach (var i in result)
        {
            Console.WriteLine(i.Name + i.Description);
        }

        Console.Read();

Here, code is working and same thing is not working with NUnit Test. Please have a look and help me out. Please let me know if any further information is needed from my side.

  • 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-27T05:58:11+00:00Added an answer on May 27, 2026 at 5:58 am

    Solved… There is a issue with NUnit Testing. It was not taking config file pefectly. So, I made two changes. Changes I have done in Project setting.

    First change is to change Application Base to bin\debug just give application base as this and then config file to .config to .exe.config and things are up and running. 🙂

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

Sidebar

Related Questions

I have been using nunit with visual studio 2010 on a windows 7 64-bit
I want to start using Nunit (finally), I am using Visual Studio 2008. Is
Using nUnit to test the output (currency formatting) for a specific culture but we
Using Visual Studio Test Suite, is there a way to make a single unit
When I write a test in Visual Studio, I check that it works by
when I try to execute the test or testmethod templates respectively in visual studio
I've just started using MSTest in a Visual Studio project (NUnit has been what
Using Visual Studio / C#, I've been debugging some nunit tests recently, and am
I'm using Visual studio (sometimes resharper) to run my unit test. I heard about
I'm looking into using Visual Studio 2008's built in unit test projects instead of

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.