RavenDB.TestDriver 7.2.0

Prefix Reserved
dotnet add package RavenDB.TestDriver --version 7.2.0
                    
NuGet\Install-Package RavenDB.TestDriver -Version 7.2.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="RavenDB.TestDriver" Version="7.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="RavenDB.TestDriver" Version="7.2.0" />
                    
Directory.Packages.props
<PackageReference Include="RavenDB.TestDriver" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add RavenDB.TestDriver --version 7.2.0
                    
#r "nuget: RavenDB.TestDriver, 7.2.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package RavenDB.TestDriver@7.2.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=RavenDB.TestDriver&version=7.2.0
                    
Install as a Cake Addin
#tool nuget:?package=RavenDB.TestDriver&version=7.2.0
                    
Install as a Cake Tool

RavenDB .NET Test Driver

You're looking at RavenDB Test Driver Client (SDK) NuGet release.
It makes it easy to write tests that require RavenDB instance, leveraging embedded server and providing you friendly API.

RavenDB is a NoSQL database that fuses extreme performance with ease-of-use, offering above the roof developer experience.
Learn more at https://ravendb.net or visit our GitHub repository.

Installation

Get the latest stable version from NuGet.

Learning resources

Community

Getting started

Configure

var testServerOptions = new TestServerOptions
{
    // Looks for the newest version on your machine including 3.1.15 and any newer patches
    // but not major new releases (default is .NET version at time of server release).
    FrameworkVersion = "3.1.15+",

    // Specifies where ravendb server binaries are located (Optional)
    ServerDirectory = "PATH_TO_RAVENDB_SERVER",

    // Specifies where ravendb data will be placed/located (Optional)
    DataDirectory = "PATH_TO_RAVENDB_DATADIR", 
};

ConfigureServer(testServerOptions);

Write a test

using Raven.Client.Documents;
using Raven.TestDriver;
using Xunit;
using System.Linq;
using Raven.Client.Documents.Indexes;

namespace RavenDBTestDriverFullExample
{

    public class RavenDBTestDriver : RavenTestDriver
    {
        static RavenDBTestDriver()
        {
            // ConfigureServer() must be set before calling GetDocumentStore()
            // and can only be set once per test run.
            ConfigureServer(new TestServerOptions
            {
                DataDirectory = "C:\\RavenDBTestDir"
            });
        }
        // This allows us to modify the conventions of the store we get from 'GetDocumentStore'
        protected override void PreInitialize(IDocumentStore documentStore)
        {
            documentStore.Conventions.MaxNumberOfRequestsPerSession = 50;
        }

        [Fact]
        public void MyFirstTest()
        {
            // GetDocumentStore() evokes the Document Store, which establishes and manages communication
            // between your client application and a RavenDB cluster via HTTP requests.
            using (var store = GetDocumentStore())
            {
                store.ExecuteIndex(new TestDocumentByName());
                using (var session = store.OpenSession())
                {
                    session.Store(new TestDocument { Name = "Hello world!" });
                    session.Store(new TestDocument { Name = "Goodbye..." });
                    session.SaveChanges();
                }
                // If we want to query documents, sometimes we need to wait for the indexes to catch up  
                // to prevent using stale indexes.
                WaitForIndexing(store);

                // Sometimes we want to debug the test itself. This method redirects us to the studio
                // so that we can see if the code worked as expected (in this case, created two documents).
                WaitForUserToContinueTheTest(store);

                // Queries are defined in the session scope.
                // If there is no relevant index to quickly answer the query, RavenDB creates an auto-index
                // based on the query parameters.
                // This query will use the static index defined in lines 63-70 and filter the results by name.
                using (var session = store.OpenSession())
                {
                    var query = session.Query<TestDocument, TestDocumentByName>()
                        .Where(x => x.Name == "hello").ToList();
                    Assert.Single(query);
                }
            }
        }
    }
    // AbstractIndexCreationTask allows you to create and manually define a static index. 
    public class TestDocumentByName : AbstractIndexCreationTask<TestDocument>
    {
        public TestDocumentByName()
        {
            Map = docs => from doc in docs select new { doc.Name };
            Indexes.Add(x => x.Name, FieldIndexing.Search);
        }
    }

    public class TestDocument
    {
        public string Name { get; set; }
    }
}

Contributing

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 is compatible.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on RavenDB.TestDriver:

Package Downloads
ECommerce.Data.RavenDbProvider

a resilient abstract data access. StartPoint ECommerce.DataAccess based on Hexagonal architecture gives you the capacity to access any data source with retrying and fallback action

GitHub repositories (10)

Showing the top 10 popular GitHub repositories that depend on RavenDB.TestDriver:

Repository Stars
JasperFx/wolverine
Supercharged .NET server side development!
Aguafrommars/TheIdServer
OpenID/Connect, OAuth2, WS-Federation and SAML 2.0 server based on Duende IdentityServer and ITFoxtec Identity SAML 2.0 with its admin UI
CommunityToolkit/Aspire
A community project with additional components and extensions for Aspire
linkdotnet/Blog
A blog (engine) completely written in C# and Blazor. It aims to be a simple use and easy to extend platform. Blogposts are written in Markdown and are rendered to HTML. This gives all the flexibility needed to express yourself but also have an easy way of creating posts in the first place.
TcOpenGroup/TcOpen
Application framework for industrial automation built on top of TwinCAT3 and .NET.
RemyDuijkeren/NodaMoney
NodaMoney provides a library that treats Money as a first class citizen and handles all the ugly bits like currencies and formatting.
stoveproject/Stove
Domain Driven Design oriented application framework, meets CRUD needs
linkdotnet/BlogExamples
Contains all of my examples from various blog posts
RemiBou/Toss.Blazor
Experimental project using AspNetCore Blazor
ravendb/samples-yabt
"Yet Another Bug Tracker" solution sample for RavenDB and .NET with Angular UI
Version Downloads Last Updated
7.2.0 298 2/2/2026
7.2.0-rc-72002 100 1/27/2026
7.2.0-rc-72001 85 1/26/2026
7.2.0-rc-72000 203 1/21/2026
7.1.6 129 2/2/2026
7.1.6-rc-71029 80 1/21/2026
7.1.5 3,365 12/22/2025
7.1.5-rc-71026 275 12/18/2025
7.1.5-rc-71025 427 12/11/2025
7.1.4 4,781 11/12/2025
7.1.4-rc-71023 150 11/7/2025
7.1.4-rc-71022 193 10/29/2025
7.1.4-rc-71020 225 10/27/2025
7.1.3 6,906 10/2/2025
7.1.3-rc-71017 193 10/2/2025
7.1.3-rc-71014 341 9/17/2025
7.1.2 10,438 8/19/2025
7.1.2-rc-71011 191 8/11/2025
7.1.2-rc-71008 284 8/6/2025
7.1.1 6,059 7/22/2025
7.1.1-rc-71006 216 7/8/2025
7.1.0 6,586 7/1/2025
7.1.0-rc-71004 205 6/25/2025
7.1.0-rc-71003 203 6/18/2025
7.1.0-rc-71000 233 5/29/2025
7.0.9 202 12/22/2025
7.0.8 336 11/12/2025
7.0.7 259 10/2/2025
7.0.6 298 8/19/2025
7.0.5 689 7/22/2025
7.0.4 980 6/25/2025
7.0.3 1,357 6/10/2025
7.0.2 12,315 4/29/2025
7.0.1 6,375 3/27/2025
7.0.0 14,633 2/4/2025
6.2.13 116 2/2/2026
6.2.12 3,379 12/22/2025
6.2.11 2,778 11/12/2025
6.2.10 5,765 10/2/2025
6.2.9 4,430 8/19/2025
6.2.8 1,621 7/22/2025
6.2.7 429 6/25/2025
6.2.6 3,694 6/10/2025
6.2.5 8,805 4/29/2025
6.2.4 2,737 3/18/2025
6.2.3 40,734 1/21/2025
6.2.2 41,894 12/11/2024
6.2.1 25,911 10/30/2024
6.2.0 10,583 9/17/2024
6.0.110 934 3/18/2025
6.0.109 1,511 1/21/2025
6.0.108 440 12/11/2024
6.0.107 1,191 10/30/2024
6.0.106 8,959 9/17/2024
6.0.105 22,101 7/23/2024
6.0.104 11,095 6/17/2024
6.0.103 6,919 5/16/2024
6.0.102 14,222 4/29/2024
6.0.101 47,434 3/19/2024
6.0.100 60,279 2/12/2024
6.0.4 7,030 1/19/2024
6.0.3 60,623 1/16/2024
6.0.2 2,628 12/27/2023
6.0.1 5,335 11/14/2023
6.0.0 4,420 10/2/2023
5.4.213 918 11/12/2025
5.4.212 991 10/2/2025
5.4.211 3,138 8/19/2025
5.4.210 1,023 7/22/2025
5.4.209 745 6/10/2025
5.4.208 3,403 4/29/2025
5.4.207 1,395 3/18/2025
5.4.206 13,101 1/21/2025
5.4.205 11,647 12/11/2024
5.4.204 11,869 10/30/2024
5.4.203 12,958 10/2/2024
5.4.202 759 9/17/2024
5.4.201 14,205 7/23/2024
5.4.200 19,218 6/17/2024
5.4.119 2,843 5/16/2024
5.4.118 3,836 4/29/2024
5.4.117 11,913 3/19/2024
5.4.116 9,230 2/12/2024
5.4.115 2,756 1/18/2024
5.4.114 301 1/16/2024
5.4.113 8,511 12/27/2023
5.4.112 202,958 11/14/2023
5.4.111 10,467 10/3/2023
5.4.110 3,621 9/12/2023
5.4.109 16,008 8/1/2023
5.4.107 5,214 6/23/2023
5.4.106 428 6/22/2023
5.4.105 847 6/20/2023
5.4.104 37,224 5/12/2023
5.4.103 27,318 3/30/2023
5.4.102 4,313 3/27/2023
5.4.101 15,553 2/13/2023
5.4.100 18,842 1/9/2023
5.4.5 55,780 11/21/2022
5.4.4 14,256 10/12/2022
5.4.3 935 10/10/2022
5.4.2 18,731 9/1/2022
5.4.1 36,378 7/19/2022
5.4.0 11,993 7/18/2022
5.3.108 40,337 1/9/2023
5.3.107 3,474 11/21/2022
5.3.106 669 10/10/2022
5.3.105 745 9/1/2022
5.3.104 2,043 7/18/2022
5.3.103 29,736 6/7/2022
5.3.102 56,374 4/19/2022
5.3.101 24,533 3/15/2022
5.3.100 32,520 2/1/2022
5.3.2 10,123 1/7/2022
5.3.1 5,863 12/21/2021
5.3.0 4,914 11/29/2021
5.2.116 311 8/1/2023
5.2.115 329 6/23/2023
5.2.114 326 6/22/2023
5.2.113 330 6/20/2023
5.2.112 647 5/12/2023
5.2.111 718 3/30/2023
5.2.110 983 3/27/2023
5.2.109 789 2/13/2023
5.2.108 3,656 1/9/2023
5.2.107 573 11/21/2022
5.2.106 671 10/10/2022
5.2.105 688 9/1/2022
5.2.104 726 7/18/2022
5.2.103 746 6/7/2022
5.2.102 11,354 4/19/2022
5.2.101 18,818 3/15/2022
5.2.100 1,042 2/1/2022
5.2.6 962 1/7/2022
5.2.5 642 12/21/2021
5.2.4 13,717 11/15/2021
5.2.3 8,758 9/29/2021
5.2.2 17,682 8/16/2021
5.2.1 2,385 7/1/2021
5.2.0 4,071 6/21/2021
5.1.13 616 12/21/2021
5.1.12 718 11/15/2021
5.1.11 724 9/29/2021
5.1.10 742 8/16/2021
5.1.9 12,020 7/1/2021
5.1.8 3,998 5/26/2021
5.1.7 20,702 4/23/2021
5.1.6 2,664 4/13/2021
5.1.5 8,016 3/1/2021
5.1.4 9,482 2/1/2021
5.1.3 1,029 1/25/2021
5.1.2 6,109 12/11/2020
5.1.1 2,530 12/1/2020
5.1.0 1,660 11/18/2020
5.0.14 1,298 6/16/2021
5.0.13 784 5/24/2021
5.0.12 12,187 4/23/2021
5.0.11 4,111 4/13/2021
5.0.10 935 3/1/2021
5.0.9 926 2/1/2021
5.0.8 2,511 1/25/2021
5.0.7 3,707 12/11/2020
5.0.6 858 12/1/2020
5.0.5 18,104 11/16/2020
5.0.4 1,077 11/10/2020
5.0.3 4,869 9/28/2020
5.0.2 7,577 8/17/2020
5.0.1 1,615 8/5/2020
5.0.0 4,380 7/23/2020
4.2.124 393 6/19/2023
4.2.123 3,505 6/7/2022
4.2.122 1,418 4/19/2022
4.2.121 1,211 3/15/2022
4.2.120 2,355 2/1/2022
4.2.119 637 12/21/2021
4.2.118 1,261 11/15/2021
4.2.117 1,155 9/29/2021
4.2.116 1,415 8/16/2021
4.2.115 1,143 7/1/2021
4.2.114 2,656 5/24/2021
4.2.113 2,739 4/23/2021
4.2.112 945 4/13/2021
4.2.111 3,275 3/1/2021
4.2.110 1,972 2/1/2021
4.2.109 854 1/25/2021
4.2.108 3,545 11/16/2020
4.2.107 856 11/10/2020
4.2.106 6,550 9/28/2020
4.2.105 11,010 8/17/2020
4.2.104 2,488 7/22/2020
4.2.103 13,853 5/25/2020
4.2.102 5,437 4/15/2020
4.2.101 11,928 3/3/2020
4.2.100 1,011 3/2/2020
4.2.8 15,956 1/21/2020
4.2.6 7,225 12/9/2019
4.2.5 2,851 11/25/2019
4.2.5-patch-42026 671 11/13/2019
4.2.4 3,572 10/14/2019
4.2.4-patch-42020 663 9/27/2019
4.2.3 13,068 8/26/2019
4.2.2 9,620 7/15/2019
4.2.1 1,943 6/27/2019
4.2.0 3,746 5/21/2019
4.2.0-rc-42008 720 5/8/2019
4.2.0-rc-42007 748 4/25/2019
4.2.0-rc-42005 727 4/17/2019
4.2.0-rc-42003 713 4/12/2019
4.2.0-rc-42002 729 4/5/2019
4.2.0-rc-42001 718 3/22/2019
4.2.0-rc-42000 751 3/22/2019
4.1.10 1,440 11/25/2019
4.1.9 923 10/14/2019
4.1.9-patch-41022 649 9/27/2019
4.1.8 2,295 8/26/2019
4.1.8-patch-41017 679 7/15/2019
4.1.7 993 6/27/2019
4.1.6 1,093 5/21/2019
4.1.5 1,737 4/15/2019
4.1.5-patch-41012 794 3/15/2019
4.1.4 11,180 2/13/2019
4.1.4-patch-41009 832 2/1/2019
4.1.4-patch-41008 2,336 1/7/2019
4.1.3 4,815 11/19/2018
4.1.3-patch-41006 1,367 11/5/2018
4.1.3-patch-41005 950 10/22/2018
4.1.2 5,803 10/15/2018
4.1.1 4,402 9/14/2018
4.1.0 1,805 8/31/2018
4.1.0-rc-41000 995 8/17/2018
4.0.11 1,369 2/28/2019
4.0.10 1,083 2/13/2019
4.0.10-patch-40057 781 2/1/2019
4.0.10-patch-40056 819 1/7/2019
4.0.9 1,126 11/19/2018
4.0.9-patch-40054 952 11/5/2018
4.0.9-patch-40052 912 10/22/2018
4.0.8 1,206 10/15/2018
4.0.7 1,237 8/31/2018
4.0.6 2,782 8/3/2018
4.0.6-patch-40047 1,202 7/2/2018
4.0.5 6,500 6/12/2018
4.0.4-patch-40038 1,448 5/18/2018
4.0.3 18,529 4/23/2018
4.0.3-patch-40034 1,953 3/30/2018
4.0.3-patch-40033 1,450 3/19/2018
4.0.3-patch-40031 1,483 3/7/2018
4.0.2 3,832 2/26/2018
4.0.1 1,784 2/20/2018
4.0.0 2,213 2/6/2018