markus / ConvertService / ServiceBase / Markus.Service.DataBase.Test / DataBaseDocPage.cs @ c1946e9c
이력 | 보기 | 이력해설 | 다운로드 (2.03 KB)
1 | 731c84b8 | taeseongkim | using NUnit.Framework; |
---|---|---|---|
2 | using System; |
||
3 | using System.Collections.Generic; |
||
4 | |||
5 | namespace Markus.Service.DataBase.Test |
||
6 | { |
||
7 | f6c94121 | taeseongkim | public class DataBaseDocPage : TestBaseMSSQL |
8 | 731c84b8 | taeseongkim | { |
9 | ddc223b4 | GeunHo Song | [Test, Description("DocPageInsert")] |
10 | 731c84b8 | taeseongkim | public void DocPageInsert() |
11 | { |
||
12 | ddc223b4 | GeunHo Song | string newConvertDocID = string.Empty; |
13 | string newDocInfo = string.Empty; |
||
14 | using (Markus.Service.DataBase.Repositories.ConvertDocRepository repository = new Repositories.ConvertDocRepository(ConnectionStr, dbtype)) |
||
15 | 731c84b8 | taeseongkim | { |
16 | ddc223b4 | GeunHo Song | newConvertDocID = repository.CreateAsync(ProjectNo, docUri, "111111").GetAwaiter().GetResult(); |
17 | Console.WriteLine($"new id : {newConvertDocID}"); |
||
18 | } |
||
19 | 731c84b8 | taeseongkim | |
20 | ddc223b4 | GeunHo Song | if (!string.IsNullOrEmpty(newConvertDocID)) |
21 | { |
||
22 | using (Markus.Service.DataBase.Repositories.DOCINFORepository repository = new Repositories.DOCINFORepository(ConnectionStr, dbtype)) |
||
23 | 731c84b8 | taeseongkim | { |
24 | ddc223b4 | GeunHo Song | newDocInfo = repository.CreateAsync(newConvertDocID, 10).GetAwaiter().GetResult(); |
25 | |||
26 | Console.WriteLine($"new id : {newDocInfo}"); |
||
27 | 731c84b8 | taeseongkim | } |
28 | |||
29 | |||
30 | ddc223b4 | GeunHo Song | 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 | 9e974b65 | GeunHo Song | if (result) |
43 | { |
||
44 | Assert.Pass(); |
||
45 | } |
||
46 | c1946e9c | GeunHo Song | |
47 | |||
48 | ddc223b4 | GeunHo Song | } |
49 | } |
||
50 | 731c84b8 | taeseongkim | } |
51 | c1946e9c | GeunHo Song | Assert.Fail(); |
52 | 731c84b8 | taeseongkim | } |
53 | } |
||
54 | } |