소스 검색

tests

master
yangxiaodong 7 년 전
부모
커밋
6bce650b2c
2개의 변경된 파일45개의 추가작업 그리고 45개의 파일을 삭제
  1. +1
    -1
      appveyor.yml
  2. +44
    -44
      test/DotNetCore.CAP.SqlServer.Test/SqlServerStorageTest.cs

+ 1
- 1
appveyor.yml 파일 보기

@@ -15,7 +15,7 @@ artifacts:
deploy:
provider: NuGet
on:
appveyor_repo_tag: false
appveyor_repo_tag: true
api_key:
secure: U62rpGTEqztrUO4ncscm4XSaAoCSmWwT/rOWO/2JJS44psJvl0QpjRL0o0ughMoY
skip_symbols: true


+ 44
- 44
test/DotNetCore.CAP.SqlServer.Test/SqlServerStorageTest.cs 파일 보기

@@ -5,37 +5,37 @@ namespace DotNetCore.CAP.SqlServer.Test
{
public class SqlServerStorageTest : DatabaseTestHost
{
// [Fact]
// public void Database_IsExists()
// {
// var master = ConnectionUtil.GetMasterConnectionString();
// using (var connection = ConnectionUtil.CreateConnection(master))
// {
// var databaseName = ConnectionUtil.GetDatabaseName();
// var sql = $@"
//IF EXISTS (SELECT * FROM sysdatabases WHERE name = N'{databaseName}')
//SELECT 'True'
//ELSE
//SELECT 'False'";
// var result = connection.QueryFirst<bool>(sql);
// Assert.Equal(true, result);
// }
// }
[Fact]
public void Database_IsExists()
{
var master = ConnectionUtil.GetMasterConnectionString();
using (var connection = ConnectionUtil.CreateConnection(master))
{
var databaseName = ConnectionUtil.GetDatabaseName();
var sql = $@"
IF EXISTS (SELECT * FROM sysdatabases WHERE name = N'{databaseName}')
SELECT 'True'
ELSE
SELECT 'False'";
var result = connection.QueryFirst<bool>(sql);
Assert.Equal(true, result);
}
}

// [Fact]
// public void DatabaseTable_Published_IsExists()
// {
// using (var connection = ConnectionUtil.CreateConnection())
// {
// var sql = @"
//IF OBJECT_ID(N'[Cap].[Published]',N'U') IS NOT NULL
//SELECT 'True'
//ELSE
//SELECT 'False'";
// var result = connection.QueryFirst<bool>(sql);
// Assert.Equal(true, result);
// }
// }
[Fact]
public void DatabaseTable_Published_IsExists()
{
using (var connection = ConnectionUtil.CreateConnection())
{
var sql = @"
IF OBJECT_ID(N'[Cap].[Published]',N'U') IS NOT NULL
SELECT 'True'
ELSE
SELECT 'False'";
var result = connection.QueryFirst<bool>(sql);
Assert.Equal(true, result);
}
}

[Fact]
public void DatabaseTable_Queue_IsExists()
@@ -52,19 +52,19 @@ SELECT 'False'";
}
}

// [Fact]
// public void DatabaseTable_Received_IsExists()
// {
// using (var connection = ConnectionUtil.CreateConnection())
// {
// var sql = @"
//IF OBJECT_ID(N'[Cap].[Received]',N'U') IS NOT NULL
//SELECT 'True'
//ELSE
//SELECT 'False'";
// var result = connection.QueryFirst<bool>(sql);
// Assert.Equal(true, result);
// }
// }
[Fact]
public void DatabaseTable_Received_IsExists()
{
using (var connection = ConnectionUtil.CreateConnection())
{
var sql = @"
IF OBJECT_ID(N'[Cap].[Received]',N'U') IS NOT NULL
SELECT 'True'
ELSE
SELECT 'False'";
var result = connection.QueryFirst<bool>(sql);
Assert.Equal(true, result);
}
}
}
}

불러오는 중...
취소
저장