[modules/identityserver] fix mongo.exe dispose

pull/2414/head
Mehmet Tüken 6 years ago
parent 96f7b57ab7
commit 18344cbdae

@ -1,5 +1,4 @@
using System;
using Mongo2Go;
using Volo.Abp.Data;
using Volo.Abp.Identity.MongoDB;
using Volo.Abp.IdentityServer.MongoDB;
@ -15,11 +14,9 @@ namespace Volo.Abp.IdentityServer
)]
public class AbpIdentityServerMongoDbTestModule : AbpModule
{
private static readonly MongoDbRunner MongoDbRunner = MongoDbRunner.Start();
public override void ConfigureServices(ServiceConfigurationContext context)
{
var connectionString = MongoDbRunner.ConnectionString.EnsureEndsWith('/') +
var connectionString = MongoDbFixture.ConnectionString.EnsureEndsWith('/') +
"Db_" +
Guid.NewGuid().ToString("N");

@ -1,6 +1,8 @@

using Xunit;
namespace Volo.Abp.IdentityServer
{
[Collection(MongoTestCollection.Name)]
public class ApiResourceRepository_Tests : ApiResourceRepository_Tests<AbpIdentityServerMongoDbTestModule>
{
}

@ -1,9 +1,8 @@
using System;
using System.Collections.Generic;
using System.Text;
using Xunit;
namespace Volo.Abp.IdentityServer
{
[Collection(MongoTestCollection.Name)]
public class ClientRepository_Tests : ClientRepository_Tests<AbpIdentityServerMongoDbTestModule>
{

@ -1,9 +1,8 @@
using System;
using System.Collections.Generic;
using System.Text;
using Xunit;
namespace Volo.Abp.IdentityServer
{
[Collection(MongoTestCollection.Name)]
public class IdentityResourceRepository_Tests : IdentityResourceRepository_Tests<AbpIdentityServerMongoDbTestModule>
{
}

@ -0,0 +1,16 @@
using System;
using Mongo2Go;
namespace Volo.Abp.IdentityServer
{
public class MongoDbFixture : IDisposable
{
private static readonly MongoDbRunner MongoDbRunner = MongoDbRunner.Start();
public static readonly string ConnectionString = MongoDbRunner.ConnectionString;
public void Dispose()
{
MongoDbRunner?.Dispose();
}
}
}

@ -0,0 +1,10 @@
using Xunit;
namespace Volo.Abp.IdentityServer
{
[CollectionDefinition(Name)]
public class MongoTestCollection : ICollectionFixture<MongoDbFixture>
{
public const string Name = "MongoDB Collection";
}
}

@ -1,9 +1,8 @@
using System;
using System.Collections.Generic;
using System.Text;
using Xunit;
namespace Volo.Abp.IdentityServer
{
[Collection(MongoTestCollection.Name)]
public class PersistentGrantRepository_Tests : PersistentGrantRepository_Tests<AbpIdentityServerMongoDbTestModule>
{

Loading…
Cancel
Save