프로젝트

일반

사용자정보

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

markus / ConvertService / ServiceBase / Markus.Service.DataBase.Test / DataBaseDocPage.cs @ 9e974b65

이력 | 보기 | 이력해설 | 다운로드 (2.31 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
                Assert.Pass(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
                    Assert.Pass(newDocInfo);
29
                }
30

    
31

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

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

    
43
                        var result = repository.CreateAsync(pages).GetAwaiter().GetResult();
44
                        if (result)
45
                        {
46
                            Assert.Pass();
47
                        }
48
                        else
49
                        {
50
                            Assert.Fail();
51
                        }
52
                    }
53
                }
54
                else
55
                {
56
                    Assert.Fail();
57
                }
58
            }
59

    
60
        }
61
    }
62
}
클립보드 이미지 추가 (최대 크기: 500 MB)