public class DatabaseFixture : IDisposable { public TestCluster Cluster { get; } public IGrainFactory GrainFactory => Cluster?.GrainFactory; public IClusterClient Client => Cluster?.Client; private const string _databaseConnection = @"Server=(localdb)\MSSQLLocalDB;Integrated Security=true"; public DatabaseFixture() { // Find a valid folder for now foreach (var folder in _dbFolders) { if (!Directory.Exists(folder)) continue; _databaseRootFolder = folder; break; } Assert.NotNull(_databaseRootFolder); // Create the test database CreateDatabase(); CreateConfigDatabase(); // Setup and start the cluster var builder = new TestClusterBuilder(2); builder.AddSiloBuilderConfigurator<DbTestSiloBuilderConfigurator>(); var testCluster = builder.Build(); if (testCluster?.Primary == null) { testCluster?.Deploy(); } Cluster = testCluster; } // other methods that follow have been removed for keeping question short }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)