markus / ConvertService / ServiceBase / Markus.Service.DataBase.Test / DataBaseDocPagePG.cs @ 9e974b65
이력 | 보기 | 이력해설 | 다운로드 (2.33 KB)
1 |
using NUnit.Framework; |
---|---|
2 |
using System; |
3 |
using System.Collections.Generic; |
4 |
using System.Diagnostics; |
5 |
|
6 |
namespace Markus.Service.DataBase.Test |
7 |
{ |
8 |
public class DataBaseDocPagePG : TestBasePG |
9 |
{ |
10 |
[Test, Description("DocPageInsert")] |
11 |
public void DocPageInsert() |
12 |
{ |
13 |
string newConvertDocID = string.Empty; |
14 |
string newDocInfo = string.Empty; |
15 |
using (Markus.Service.DataBase.Repositories.ConvertDocRepository repository = new Repositories.ConvertDocRepository(ConnectionStr, dbtype)) |
16 |
{ |
17 |
newConvertDocID = repository.CreateAsync(ProjectNo, docUri, "111111").GetAwaiter().GetResult(); |
18 |
Console.WriteLine($"new id : {newConvertDocID}"); |
19 |
Assert.Pass(newConvertDocID); |
20 |
} |
21 |
|
22 |
if (!string.IsNullOrEmpty(newConvertDocID)) |
23 |
{ |
24 |
using (Markus.Service.DataBase.Repositories.DOCINFORepository repository = new Repositories.DOCINFORepository(ConnectionStr, dbtype)) |
25 |
{ |
26 |
newDocInfo = repository.CreateAsync(newConvertDocID, 10).GetAwaiter().GetResult(); |
27 |
|
28 |
Console.WriteLine($"new id : {newDocInfo}"); |
29 |
Assert.Pass(newDocInfo); |
30 |
} |
31 |
|
32 |
|
33 |
if (!string.IsNullOrEmpty(newDocInfo)) |
34 |
{ |
35 |
using (Markus.Service.DataBase.Repositories.DOCPAGERepository repository = new Repositories.DOCPAGERepository(ConnectionStr, dbtype)) |
36 |
{ |
37 |
List<Entities.DOCPAGE> pages = new List<Entities.DOCPAGE>(); |
38 |
|
39 |
for (int i = 0; i < 1000; i++) |
40 |
{ |
41 |
pages.Add(new Entities.DOCPAGE { DOCINFO_ID = newDocInfo, PAGE_NUMBER = i + 1, PAGE_WIDTH = "1210", PAGE_HEIGHT = "1210", PAGE_ANGLE = 0 }); |
42 |
} |
43 |
|
44 |
var result = repository.CreateAsync(pages).GetAwaiter().GetResult(); |
45 |
if (result) |
46 |
{ |
47 |
Assert.Pass(); |
48 |
} |
49 |
else |
50 |
{ |
51 |
Assert.Fail(); |
52 |
} |
53 |
} |
54 |
} |
55 |
else |
56 |
{ |
57 |
Assert.Fail(); |
58 |
} |
59 |
} |
60 |
|
61 |
} |
62 |
} |
63 |
} |