프로젝트

일반

사용자정보

통계
| 브랜치(Branch): | 개정판:

markus / ConvertService / ServiceBase / Markus.Service.DataBase.Test / DataBaseDocPagePG.cs @ c1946e9c

이력 | 보기 | 이력해설 | 다운로드 (2.06 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
            }
20

    
21
            if (!string.IsNullOrEmpty(newConvertDocID))
22
            {
23
                using (Markus.Service.DataBase.Repositories.DOCINFORepository repository = new Repositories.DOCINFORepository(ConnectionStr, dbtype))
24
                {
25
                    newDocInfo = repository.CreateAsync(newConvertDocID, 10).GetAwaiter().GetResult();
26

    
27
                    Console.WriteLine($"new id : {newDocInfo}");
28
                }
29

    
30

    
31
                if (!string.IsNullOrEmpty(newDocInfo))
32
                {
33
                    using (Markus.Service.DataBase.Repositories.DOCPAGERepository repository = new Repositories.DOCPAGERepository(ConnectionStr, dbtype))
34
                    {
35
                        List<Entities.DOCPAGE> pages = new List<Entities.DOCPAGE>();
36

    
37
                        for (int i = 0; i < 20000; i++)
38
                        {
39
                            pages.Add(new Entities.DOCPAGE { DOCINFO_ID = newDocInfo, PAGE_NUMBER = i + 1, PAGE_WIDTH = "1210", PAGE_HEIGHT = "1210", PAGE_ANGLE = 0 });
40
                        }
41

    
42
                        var result = repository.CreateAsync(pages).GetAwaiter().GetResult();
43
                        if (result)
44
                        {
45
                            Assert.Pass();
46
                        }
47

    
48

    
49
                    }
50
                }
51
            }
52
            Assert.Fail();
53
        }
54
    }
55
}
클립보드 이미지 추가 (최대 크기: 500 MB)