Browse Source

update unit tests.

master
yangxiaodong 7 years ago
parent
commit
3ad72f4277
2 changed files with 9 additions and 8 deletions
  1. +6
    -5
      test/DotNetCore.CAP.SqlServer.Test/SqlServerStorageConnectionTest.cs
  2. +3
    -3
      test/DotNetCore.CAP.SqlServer.Test/SqlServerStorageTest.cs

+ 6
- 5
test/DotNetCore.CAP.SqlServer.Test/SqlServerStorageConnectionTest.cs View File

@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using Dapper;
using DotNetCore.CAP.Infrastructure;
using DotNetCore.CAP.Models;
@@ -19,7 +20,7 @@ namespace DotNetCore.CAP.SqlServer.Test
}

[Fact]
public async void GetPublishedMessageAsync_Test()
public async Task GetPublishedMessageAsync_Test()
{
var sql = "INSERT INTO [Cap].[Published]([Name],[Content],[Retries],[Added],[ExpiresAt],[StatusName]) OUTPUT INSERTED.Id VALUES(@Name,@Content,@Retries,@Added,@ExpiresAt,@StatusName);";
var publishMessage = new CapPublishedMessage
@@ -40,7 +41,7 @@ namespace DotNetCore.CAP.SqlServer.Test
}

[Fact]
public async void FetchNextMessageAsync_Test()
public async Task FetchNextMessageAsync_Test()
{
var sql = "INSERT INTO [Cap].[Queue]([MessageId],[MessageType]) VALUES(@MessageId,@MessageType);";
var queue = new CapQueue
@@ -60,7 +61,7 @@ namespace DotNetCore.CAP.SqlServer.Test
}

[Fact]
public async void StoreReceivedMessageAsync_Test()
public async Task StoreReceivedMessageAsync_Test()
{
var receivedMessage = new CapReceivedMessage
{
@@ -83,7 +84,7 @@ namespace DotNetCore.CAP.SqlServer.Test
}

[Fact]
public async void GetReceivedMessageAsync_Test()
public async Task GetReceivedMessageAsync_Test()
{

var sql = $@"
@@ -111,7 +112,7 @@ VALUES(@Name,@Group,@Content,@Retries,@Added,@ExpiresAt,@StatusName);";
}

[Fact]
public async void GetNextReceviedMessageToBeEnqueuedAsync_Test()
public async Task GetNextReceviedMessageToBeEnqueuedAsync_Test()
{
var receivedMessage = new CapReceivedMessage
{


+ 3
- 3
test/DotNetCore.CAP.SqlServer.Test/SqlServerStorageTest.cs View File

@@ -28,7 +28,7 @@ SELECT 'False'";
using (var connection = ConnectionUtil.CreateConnection())
{
var sql = @"
IF OBJECT_ID(N'[CAP].[Published]',N'U') IS NOT NULL
IF OBJECT_ID(N'[Cap].[Published]',N'U') IS NOT NULL
SELECT 'True'
ELSE
SELECT 'False'";
@@ -43,7 +43,7 @@ SELECT 'False'";
using (var connection = ConnectionUtil.CreateConnection())
{
var sql = @"
IF OBJECT_ID(N'[CAP].[Queue]',N'U') IS NOT NULL
IF OBJECT_ID(N'[Cap].[Queue]',N'U') IS NOT NULL
SELECT 'True'
ELSE
SELECT 'False'";
@@ -58,7 +58,7 @@ SELECT 'False'";
using (var connection = ConnectionUtil.CreateConnection())
{
var sql = @"
IF OBJECT_ID(N'[CAP].[Received]',N'U') IS NOT NULL
IF OBJECT_ID(N'[Cap].[Received]',N'U') IS NOT NULL
SELECT 'True'
ELSE
SELECT 'False'";


Loading…
Cancel
Save