개정판 0fce3dac
issue #0000 dapper postgresql 수정
Change-Id: I9b298c1ca79b50f6eda83cb2bb3d412c5cc76db1
ConvertService/ServiceBase/Markus.Service.DataBase.Test/DataBaseConvertDocPG.cs | ||
---|---|---|
29 | 29 |
|
30 | 30 |
|
31 | 31 |
[Test, Description("GetConvertDocSingle Test")] |
32 |
private void GetConvertDocSingle()
|
|
32 |
public void GetConvertDocSingle()
|
|
33 | 33 |
{ |
34 | 34 |
using (Markus.Service.DataBase.Repositories.ConvertDocRepository repository = new Repositories.ConvertDocRepository(ConnectionStr, dbtype)) |
35 | 35 |
{ |
... | ... | |
49 | 49 |
using (Markus.Service.DataBase.Repositories.ConvertDocRepository repository = new Repositories.ConvertDocRepository(ConnectionStr, dbtype)) |
50 | 50 |
{ |
51 | 51 |
string sql = @"SELECT ID, PROJECT_NO, DOCUMENT_URL, DOCUMENT_ID, CREATE_DATETIME, STATUS, TOTAL_PAGE, CURRENT_PAGE, EXCEPTION, END_DATETIME, START_DATETIME, SERVICE_ID," |
52 |
+ "RECONVERTER FROM CONVERTER_DOC where CREATE_DATETIME >= @CREATE_DATETIME order by CREATE_DATETIME desc limit 10";
|
|
52 |
+ "RECONVERTER FROM CONVERTER_DOC where CREATE_DATETIME >= CREATE_DATETIME order by CREATE_DATETIME desc limit 10"; |
|
53 | 53 |
|
54 | 54 |
var parameter = new List<sqlParameter>(); |
55 |
parameter.Add(new sqlParameter("@CREATE_DATETIME", DateTime.Now.AddDays(-10), System.Data.DbType.DateTime));
|
|
55 |
parameter.Add(new sqlParameter("CREATE_DATETIME", DateTime.Now.AddDays(-10), System.Data.DbType.DateTime)); |
|
56 | 56 |
|
57 | 57 |
var items = repository.GetAsync<Markus.Service.DataBase.Entities.ConvertDoc>(sql, parameter).GetAwaiter().GetResult(); |
58 | 58 |
|
... | ... | |
62 | 62 |
} |
63 | 63 |
} |
64 | 64 |
} |
65 |
|
|
66 |
|
|
67 |
[Test, Description("Select waitOrError PostgreSQL Test")] |
|
68 |
public void SelectWaitOrError() |
|
69 |
{ |
|
70 |
using (Markus.Service.DataBase.Repositories.ConvertDocRepository repository = new Repositories.ConvertDocRepository(ConnectionStr, dbtype)) |
|
71 |
{ |
|
72 |
var items = repository.GetWaitorErrorAsync(2).GetAwaiter().GetResult(); |
|
73 |
|
|
74 |
foreach (var item in items) |
|
75 |
{ |
|
76 |
Assert.Pass(item.ID); |
|
77 |
} |
|
78 |
} |
|
79 |
} |
|
80 |
|
|
81 |
[Test, Description("SetCleanUpItem PostgreSQL Test")] |
|
82 |
public void SelectSetCleanUpItem() |
|
83 |
{ |
|
84 |
foreach (var item in newConvertDocIDs) |
|
85 |
{ |
|
86 |
using (Markus.Service.DataBase.Repositories.ConvertDocRepository repository = new Repositories.ConvertDocRepository(ConnectionStr, dbtype)) |
|
87 |
{ |
|
88 |
var items = repository.SetCleanUpItemAsync(item,1).GetAwaiter().GetResult(); |
|
89 |
|
|
90 |
Assert.Pass(item); |
|
91 |
} |
|
92 |
} |
|
93 |
} |
|
65 | 94 |
} |
66 | 95 |
} |
내보내기 Unified diff