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

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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T23:54:20+00:00 2026-06-06T23:54:20+00:00

I have a table with 2 columns. | DealerCode | TransactionID | | 222223

  • 0

I have a table with 2 columns.

| DealerCode | TransactionID |
| 222223     | 98766         |

and i have this method that returns a list

public List<Transaction> GetCurrentTransaction(string dealerCode, string transactionId)
    {
        return context.Transactions.Where(c => c.DealerCode == dealerCode && (c.TransactionID == transactionId)).ToList();
    }

however everytime i tried to unit test it, it always display true, as you can see in my testing, i purposedly created a wrong parameter so that it would fail.

Assert.IsNotNull(tran.GetCurrentTransaction("2222231", "987661"));

i have tried searching thru the forums and googling to no avail.

  • 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-06T23:54:21+00:00Added an answer on June 6, 2026 at 11:54 pm

    Your method returns an instance of List, and even though it contains no items (since there are no records matching the criteria), the list itself is still created, and therefore, not equal to NULL, and thats the reason your unittest passes.

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

Sidebar

Related Questions

I have table with two columns (varchar from, varchar to). This table represents connections
I have my table columns set like this: likes(id, like_message, timestamp) id is the
I have a table AVUKAT Columns--> HESAP, MUSTERI, AVUKAT This is my delete button
I have one table with 2 columns that i essentially want to split into
absolute newbie here: I have table with columns: resource, resource_type_field, value. I have this
i have a table with columns: ID_LOG (this is the pk) | TS (type=datetime)
I have a table with a variable number of columns that I want to
I have table with 20+ columns. Some columns have a Add link that would
The table columns have the data type BLOB and CLOB. What are the corresponding
I have table users with columns id, username, email and password. And i have

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.