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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T12:11:58+00:00 2026-05-24T12:11:58+00:00

I want to run integration tests on my store filters e.g. I filter by

  • 0

I want to run integration tests on my store filters e.g.

I filter by price and by different product attributes

are there pattern or best practices on how to assert on such a test, I’ll illustrate an example:

Say I am calling a Repository.GetOnlyTShirtsWithColorRed() in my test db I have all the possible types of items.

I may get more then 1 item back but I want to assert that they all have a Red Color and they are all T-Shirts

I have read in many books that looping and iterating in tests in bad practice but how else may I assert that no mistake was done by my code, in a more complex query this may help to catch the bugs

  • 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-24T12:11:58+00:00Added an answer on May 24, 2026 at 12:11 pm

    From what I read – you want to test that your repository implementation works with a real DB – aka integration tests.

    If the above is true, I think you’re on the right path. My assert would probably look like

    Assert.That(shirtsFromRepo.All(shirt => shirt.Color == Colors.Red), "all shirts were not red!)
    

    As for the “best practice”, can you post a link?

    AFAIK the only recommendation is to avoid complicated logic in your code (e.g. ifs and other control structures) and testing one thing per test.

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

Sidebar

Related Questions

For some integration tests I want to connect to the database and run a
I am writing integration tests.Now, before tests are run I want to setup the
I've created a project that runs integration-tests on 3 web services. There's a project
I am trying to run integration tests against a REST web service process that
I want to exclude some tests from my continuous integration build but I haven't
Sometimes I'm going nuts over different query execution plans in development, integration tests, and
I've been exploring different strategies for running integration tests within some Nant build scripts.
I use Jenkins to run some integration tests on a web appilcation (using cucumber,
I want run a script as follows: runner: ssh 'java program &' ssh 'java
Why this code don't work,when i want run this code vwd 2008 express show

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.