瀏覽代碼

update unit tests.

master
yangxiaodong 7 年之前
父節點
當前提交
3ad72f4277
共有 2 個文件被更改,包括 9 次插入8 次删除
  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 查看文件

@@ -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 查看文件

@@ -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…
取消
儲存