Browse Source

Remove dependencies of Microsoft.AspNetCore.Testing

master
yangxiaodong 7 years ago
parent
commit
0ae9769302
3 changed files with 3 additions and 21 deletions
  1. +1
    -5
      test/DotNetCore.CAP.EntityFrameworkCore.Test/DefaultPocoTest.cs
  2. +0
    -1
      test/DotNetCore.CAP.EntityFrameworkCore.Test/DotNetCore.CAP.EntityFrameworkCore.Test.csproj
  3. +2
    -15
      test/DotNetCore.CAP.EntityFrameworkCore.Test/MessageStoreTest.cs

+ 1
- 5
test/DotNetCore.CAP.EntityFrameworkCore.Test/DefaultPocoTest.cs View File

@@ -1,7 +1,6 @@
using System.Threading.Tasks; using System.Threading.Tasks;
using DotNetCore.CAP.Infrastructure; using DotNetCore.CAP.Infrastructure;
using Microsoft.AspNetCore.Builder.Internal; using Microsoft.AspNetCore.Builder.Internal;
using Microsoft.AspNetCore.Testing.xunit;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Xunit; using Xunit;
@@ -33,10 +32,7 @@ namespace DotNetCore.CAP.EntityFrameworkCore.Test
} }
} }


[ConditionalFact]
[FrameworkSkipCondition(RuntimeFrameworks.Mono)]
[OSSkipCondition(OperatingSystems.Linux)]
[OSSkipCondition(OperatingSystems.MacOSX)]
[Fact]
public async Task EnsureStartupUsageWorks() public async Task EnsureStartupUsageWorks()
{ {
var messageStore = _builder.ApplicationServices.GetRequiredService<ICapMessageStore>(); var messageStore = _builder.ApplicationServices.GetRequiredService<ICapMessageStore>();


+ 0
- 1
test/DotNetCore.CAP.EntityFrameworkCore.Test/DotNetCore.CAP.EntityFrameworkCore.Test.csproj View File

@@ -38,7 +38,6 @@
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="1.1.2" /> <PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="1.1.2" />
<PackageReference Include="System.Data.SqlClient" Version="4.3.1" /> <PackageReference Include="System.Data.SqlClient" Version="4.3.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="1.1.2" /> <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="1.1.2" />
<PackageReference Include="Microsoft.AspNetCore.Testing" Version="1.2.0-preview1-22815" />
</ItemGroup> </ItemGroup>


<ItemGroup> <ItemGroup>


+ 2
- 15
test/DotNetCore.CAP.EntityFrameworkCore.Test/MessageStoreTest.cs View File

@@ -3,8 +3,6 @@ using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using DotNetCore.CAP.Infrastructure; using DotNetCore.CAP.Infrastructure;
using DotNetCore.CAP.Test; using DotNetCore.CAP.Test;
using Microsoft.AspNetCore.Testing;
using Microsoft.AspNetCore.Testing.xunit;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Xunit; using Xunit;
@@ -20,11 +18,6 @@ namespace DotNetCore.CAP.EntityFrameworkCore.Test
_fixture = fixture; _fixture = fixture;
} }


protected override bool ShouldSkipDbTests()
{
return TestPlatformHelper.IsMono || !TestPlatformHelper.IsWindows;
}

public class ApplicationDbContext : CapDbContext public class ApplicationDbContext : CapDbContext
{ {
public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options) : base(options) public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options) : base(options)
@@ -32,10 +25,7 @@ namespace DotNetCore.CAP.EntityFrameworkCore.Test
} }
} }


[ConditionalFact]
[FrameworkSkipCondition(RuntimeFrameworks.Mono)]
[OSSkipCondition(OperatingSystems.Linux)]
[OSSkipCondition(OperatingSystems.MacOSX)]
[Fact]
public void CanCreateSentMessageUsingEF() public void CanCreateSentMessageUsingEF()
{ {
using (var db = CreateContext()) using (var db = CreateContext())
@@ -54,10 +44,7 @@ namespace DotNetCore.CAP.EntityFrameworkCore.Test
} }
} }


[ConditionalFact]
[FrameworkSkipCondition(RuntimeFrameworks.Mono)]
[OSSkipCondition(OperatingSystems.Linux)]
[OSSkipCondition(OperatingSystems.MacOSX)]
[Fact]
public async Task CanCreateUsingManager() public async Task CanCreateUsingManager()
{ {
var manager = CreateManager(); var manager = CreateManager();


Loading…
Cancel
Save