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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T23:59:44+00:00 2026-05-18T23:59:44+00:00

I am using linq to nhibernate on my project, and I’m writing unit tests

  • 0

I am using linq to nhibernate on my project, and I’m writing unit tests using Mock and SQLLite.
The domain object is mapped to the sql view using fluent nhibernate.

The problem is that this domain object uses the sql view has source, and this view has data from many tables, and only MsSQL knows that. I don’t know how to Mock this.

How do I Unit test a sql view using Mock and SQLite?

»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»

EDIT:

Sorry, my question wasn’t very clear. Let me rephrase it.

I’m using nhibernate, and writing unit tests using SQLLite.
In some cases my domain objects are mapped to views instead of tables, and so I have configured the fluent nhibernate mappings so that the corresponding tables are not generated in the SQLite database schema.

This works in the development environment because the views are created manually afterwards in a MsSQL database, but I can’t test the corresponding repositories in unit tests because they use SQLite.

How do I Unit test a sql view using SQLite?

  • 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-18T23:59:44+00:00Added an answer on May 18, 2026 at 11:59 pm

    I’ve found a solution.

    I’ve changed the mappings, so that in unit testing it generates the mapping for the domain object, creating a table in the SQLite instead of a view.
    With this I can create repositories of that object in the testing environment.

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

Sidebar

Related Questions

I have a problem using Linq to NHibernate to load an object and eagerly
Can i join two tables using LINQ for NHibernate like I can do in
Anybody know of a way to batch NHibernate queries using NHibernate.Linq like you can
I query my NHibernate datasources using a Linq Expression. The problem I have with
I'm using ASP.Net MVC (still 1.0 for now) with Castle ActiveRecord and NHibernate.Linq. All
I'm using NHibernate 2.1 with the LINQ provider and the results I get back
using Linq-to-SQL I'd like to prefetch some data. 1) the common solution is to
Background Fluent NHibernate 1.1 (with a repository implementation using LINQ to NHibernate) in an
I'm working with NHibernate 2 in a .Net project and I'm using the Linq2NHibernate
I am starting a new project using C# and ASP.NET 3.5 with SQL Server

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.