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