프로젝트

일반

사용자정보

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

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

이력 | 보기 | 이력해설 | 다운로드 (2.06 KB)

1 264f0f92 GeunHo Song
using NUnit.Framework;
2
using System;
3
using System.Collections.Generic;
4 ddc223b4 GeunHo Song
using System.Diagnostics;
5 264f0f92 GeunHo Song
6
namespace Markus.Service.DataBase.Test
7
{
8
    public class DataBaseDocPagePG : TestBasePG
9
    {
10 ddc223b4 GeunHo Song
        [Test, Description("DocPageInsert")]
11 264f0f92 GeunHo Song
        public void DocPageInsert()
12
        {
13 ddc223b4 GeunHo Song
            string newConvertDocID = string.Empty;
14
            string newDocInfo = string.Empty;
15
            using (Markus.Service.DataBase.Repositories.ConvertDocRepository repository = new Repositories.ConvertDocRepository(ConnectionStr, dbtype))
16 264f0f92 GeunHo Song
            {
17 ddc223b4 GeunHo Song
                newConvertDocID = repository.CreateAsync(ProjectNo, docUri, "111111").GetAwaiter().GetResult();
18
                Console.WriteLine($"new id : {newConvertDocID}");
19
            }
20 264f0f92 GeunHo Song
21 ddc223b4 GeunHo Song
            if (!string.IsNullOrEmpty(newConvertDocID))
22
            {
23
                using (Markus.Service.DataBase.Repositories.DOCINFORepository repository = new Repositories.DOCINFORepository(ConnectionStr, dbtype))
24 264f0f92 GeunHo Song
                {
25 ddc223b4 GeunHo Song
                    newDocInfo = repository.CreateAsync(newConvertDocID, 10).GetAwaiter().GetResult();
26
27
                    Console.WriteLine($"new id : {newDocInfo}");
28 264f0f92 GeunHo Song
                }
29
30
31 ddc223b4 GeunHo Song
                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 c1946e9c GeunHo Song
                        for (int i = 0; i < 20000; i++)
38 ddc223b4 GeunHo Song
                        {
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 9e974b65 GeunHo Song
                        if (result)
44
                        {
45
                            Assert.Pass();
46
                        }
47 c1946e9c GeunHo Song
48
49 ddc223b4 GeunHo Song
                    }
50
                }
51 264f0f92 GeunHo Song
            }
52 c1946e9c GeunHo Song
            Assert.Fail();
53 264f0f92 GeunHo Song
        }
54
    }
55
}
클립보드 이미지 추가 (최대 크기: 500 MB)