NK.MongoDB.Embedded 0.2.68

dotnet add package NK.MongoDB.Embedded --version 0.2.68
                    
NuGet\Install-Package NK.MongoDB.Embedded -Version 0.2.68
                    
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="NK.MongoDB.Embedded" Version="0.2.68" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NK.MongoDB.Embedded" Version="0.2.68" />
                    
Directory.Packages.props
<PackageReference Include="NK.MongoDB.Embedded" />
                    
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 NK.MongoDB.Embedded --version 0.2.68
                    
#r "nuget: NK.MongoDB.Embedded, 0.2.68"
                    
#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 NK.MongoDB.Embedded@0.2.68
                    
#: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=NK.MongoDB.Embedded&version=0.2.68
                    
Install as a Cake Addin
#tool nuget:?package=NK.MongoDB.Embedded&version=0.2.68
                    
Install as a Cake Tool

Build status

This project makes it possible to run unit test on a real MongoDB Instance without mocking the persistence layer.

General

The MongoServerBuilder is the base for the Mongo Server-Version to be used. Based on the OS-Configuration and the MongoDB Version, the corresponding download link generated.

Supported OS

Windows
macOS
Linux

Supported Linux Distributions

Ubuntu 16.04
Ubunut 18.04

Supported MongoDB-Versions

4.2.0
4.2.1
4.2.2
4.2.3
4.2.5
4.2.6
4.2.7
4.2.8
4.3.6

MongoServer downloads the TAR archive (or ZIP for Windows) based on the MongoServerBuilder configuration and unpacks it into the Home directory.

Example:


    public class ServerTest
    {
        [Fact]
        public async Task Should_Download_and_Start_Server()
        {
            // Arrange
            MonogServerBuilder builder = new MonogServerBuilder()
                .UseMongoVersion(MongoDbVersion.V4_2_0);
            
            // Checks the underlying operating system
            if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
                builder.UseOs(Os.Windows);
            else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
                builder.UseOs(Os.Osx);
            else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
                builder.UseOs(Os.Linux).UseDistribution(Distribution.Ubuntu_1804);
            
            MongoServer mongoServer = new MongoServer(builder)
                .UseMongoServerPort(27099);
            
            // Act
            await mongoServer.Start();
            mongoServer
                .Stop()
                .Cleanup(); // Remove MongoDB-Data after server stop
            
            // Assert
        }
    }

TODO

  • Command line argument passed to server start
  • Pass MongoDB Configuration File
  • Configure download & data directory
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 netcoreapp3.1 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.2.68 1,317 7/29/2020
0.2.66 695 7/28/2020
0.2.62 765 7/26/2020
0.2.51 704 7/26/2020