프로젝트

일반

사용자정보

개정판 9e974b65

ID9e974b6534b0393c9805e641484ea36c83de0a50
상위 7864cac7
하위 9f42e700

GeunHo Song 이(가) 약 2년 전에 추가함

issue #000 TEST 프로젝트 수정.

Change-Id: I1d49f5584f049a3e1b40fcc11105b58a9c55334e

차이점 보기:

ConvertService/ServiceBase/Markus.Service.DataBase.Dapper/Repositories/ConvertDocRepository.cs
6 6
using System.Data;
7 7
using System.Linq;
8 8
using System.Threading.Tasks;
9
using static Dapper.SqlMapper;
9 10

  
10 11
namespace Markus.Service.DataBase.Repositories
11 12
{
......
258 259
        {
259 260
            int result = 0;
260 261
            var tran = BeginTransaction();
261

  
262 262
            var parameters = new MixParameters(DBMS);
263 263
            parameters.Add("@service_id", value: ServiceID);
264 264
            parameters.Add("@id", value: ConvertDocID);
......
266 266
            parameters.Add("@total_page", value: totalPage);
267 267
            parameters.Add("@current_page", value: currentPage);
268 268
            parameters.Add("@exception", value: exception);
269

  
270 269
            result = await base.ExecuteAsync("convert_update_status", parameters, transaction: tran, commandType: CommandType.StoredProcedure);
271 270
            tran.Commit();
272

  
271
           
273 272
            return result;
274 273
        }
275 274

  
ConvertService/ServiceBase/Markus.Service.DataBase.Dapper/Repositories/DOCPAGERepository.cs
88 88
			return result;
89 89
		}
90 90

  
91
        // call stored procedure at data access layer for example StudentDAL.cs
92
        public void CallStoredResultSet<T>(InsertDocPage[] inputParameters) where T : class
93
        {
94
            //var conn = _GetOpenConnection();
95
            //var tran = _BeginTransaction(conn);
96
            
97
            var tran = BeginTransaction();
98
            NpgsqlCommand command = new NpgsqlCommand("convert_insert_docpage_arr", (NpgsqlConnection)this.Connection );
99
            command.CommandType = CommandType.StoredProcedure;
100

  
101
            var cmdParam = command.CreateParameter();
102
            cmdParam.ParameterName = "docpages";
103
            cmdParam.DbType = DbType.Object;
104
            cmdParam.Value = inputParameters;
105
            cmdParam.DataTypeName = "type_insert_docpage[]";
106
            command.Parameters.Add(cmdParam);
107
            command.ExecuteNonQueryAsync();
108
			tran.Commit();
109

  
110
            
111
        }
112

  
91
    
113 92
        public class InsertDocPage
114 93
		{
115 94
            [PgName("docinfo_id")]
......
122 101
            public string page_height { get; set; }
123 102
            [PgName("page_angle")]
124 103
            public int page_angle { get; set; }
125
            public InsertDocPage() { }
126 104
        }
127 105

  
128 106
	}
ConvertService/ServiceBase/Markus.Service.DataBase.Test/DataBaseConvertDoc.cs
22 22

  
23 23
                newConvertDocIDs.Add(newConvertDocID);
24 24
                Console.WriteLine($"new id : {newConvertDocID}");
25

  
25
                Assert.Pass(newConvertDocID);
26 26
                var newConvertDocID2 = repository.CreateAsync(ProjectNo, docUri, "A1111111").GetAwaiter().GetResult();
27 27

  
28 28
                newConvertDocIDs.Add(newConvertDocID2);
29 29
                Console.WriteLine($"new id : {newConvertDocID2}");
30
                Assert.Pass(newConvertDocID2);
30 31
            }
31 32

  
32 33

  
......
42 43
            using (Markus.Service.DataBase.Repositories.ConvertDocRepository repository = new Repositories.ConvertDocRepository(ConnectionStr, dbtype))
43 44
            {
44 45
                var newConvertDocID = repository.Create(ProjectNo, docUri, "111111").GetAwaiter().GetResult();
45

  
46
                
46 47
                newConvertDocIDs.Add(newConvertDocID);
47 48
                Console.WriteLine($"new id : {newConvertDocID}");
49
                Assert.Pass(newConvertDocID);
48 50

  
49 51
                var newConvertDocID2 = repository.Create(ProjectNo, docUri, "A1111111").GetAwaiter().GetResult();
50

  
52
                
51 53
                newConvertDocIDs.Add(newConvertDocID2);
52 54
                Console.WriteLine($"new id : {newConvertDocID2}");
55
                Assert.Pass(newConvertDocID2);
53 56
            }
54 57
        }
55 58

  
......
67 70
                foreach (var convertDocID in newConvertDocIDs)
68 71
                {
69 72
                    var convertDoc = repository.GetConvertDocSingleAsync(ProjectNo, ConvertID: convertDocID).GetAwaiter().GetResult();
70

  
73
                    Assert.Pass(convertDoc.ID);
71 74
                    Console.WriteLine($"ID : {convertDoc.ID} PROJECT_NO:{convertDoc.PROJECT_NO} DOCUMENT_URL:{convertDoc.DOCUMENT_URL} DOCUMENT_ID:{convertDoc.DOCUMENT_ID}  ConvertPath:{convertDoc.ConvertPath}  ");
72 75
                    break;
73 76
                }
......
86 89

  
87 90
                foreach (var item in items)
88 91
                {
89
                    NUnit.Framework.Assert.Pass(item.ID);
92
                    Assert.Pass(item.ID);
90 93
                }
91 94
            }
92 95
        }
......
169 172

  
170 173
                Console.WriteLine($"ID : {convertDoc.ID} PROJECT_NO:{convertDoc.PROJECT_NO} DOCUMENT_URL:{convertDoc.DOCUMENT_URL} DOCUMENT_ID:{convertDoc.DOCUMENT_ID}  ConvertPath:{convertDoc.ConvertPath}  ");
171 174

  
172
                var items = repository.UpdateStatusAsync("", convertDoc.ID, convertDoc.STATUS, convertDoc.TOTAL_PAGE, convertDoc.CURRENT_PAGE, "").GetAwaiter().GetResult();
175
                var status = repository.UpdateStatusAsync("", convertDoc.ID , convertDoc.STATUS, convertDoc.TOTAL_PAGE, convertDoc.CURRENT_PAGE, "").GetAwaiter().GetResult();
173 176

  
177
                Assert.That(status, Is.EqualTo(1));
174 178

  
179
              
175 180
            }
176 181
        }
177 182

  
ConvertService/ServiceBase/Markus.Service.DataBase.Test/DataBaseConvertDocPG.cs
23 23

  
24 24
                newConvertDocIDs.Add(newConvertDocID);
25 25
                Console.WriteLine($"new id : {newConvertDocID}");
26

  
26
                Assert.Pass(newConvertDocID);
27 27
                var newConvertDocID2 = repository.CreateAsync(ProjectNo, docUri, "A1111111").GetAwaiter().GetResult();
28 28

  
29 29
                newConvertDocIDs.Add(newConvertDocID2);
30 30
                Console.WriteLine($"new id : {newConvertDocID2}");
31
                Assert.Pass(newConvertDocID2);
31 32
            }
32 33

  
33 34
        }
34 35

  
35 36

  
36 37
        /// <summary>
37
        /// 완료
38
            /// 완료
38 39
        /// </summary>
39 40
        [Test, Description("Craete Convert Doc MSSQL Test")]
40 41
        public void CreateConvertDoc()
......
45 46

  
46 47
                newConvertDocIDs.Add(newConvertDocID);
47 48
                Console.WriteLine($"new id : {newConvertDocID}");
48

  
49
                Assert.Pass(newConvertDocID);
49 50
                var newConvertDocID2 = repository.Create(ProjectNo, docUri, "A1111111").GetAwaiter().GetResult();
50 51

  
51 52
                newConvertDocIDs.Add(newConvertDocID2);
52 53
                Console.WriteLine($"new id : {newConvertDocID2}");
54
                Assert.Pass(newConvertDocID2);
55

  
53 56
            }
54 57
        }
55 58

  
......
66 69
                foreach (var convertDocID in newConvertDocIDs)
67 70
                {
68 71
                    var convertDoc = repository.GetConvertDocSingleAsync(ProjectNo, ConvertID: convertDocID).GetAwaiter().GetResult();
69

  
72
                    Assert.Pass(convertDoc.ID);
70 73
                    Console.WriteLine($"ID : {convertDoc.ID} PROJECT_NO:{convertDoc.PROJECT_NO} DOCUMENT_URL:{convertDoc.DOCUMENT_URL} DOCUMENT_ID:{convertDoc.DOCUMENT_ID}  ConvertPath:{convertDoc.ConvertPath}  ");
71 74
                }
72 75

  
......
167 170

  
168 171
                Console.WriteLine($"ID : {convertDoc.ID} PROJECT_NO:{convertDoc.PROJECT_NO} DOCUMENT_URL:{convertDoc.DOCUMENT_URL} DOCUMENT_ID:{convertDoc.DOCUMENT_ID}  ConvertPath:{convertDoc.ConvertPath}  ");
169 172

  
170
                var items = repository.UpdateStatusAsync("", convertDoc.ID, convertDoc.STATUS, convertDoc.TOTAL_PAGE, convertDoc.CURRENT_PAGE, "").GetAwaiter().GetResult();
173
                var status = repository.UpdateStatusAsync("", convertDoc.ID, convertDoc.STATUS, convertDoc.TOTAL_PAGE, convertDoc.CURRENT_PAGE, "").GetAwaiter().GetResult();
171 174

  
172
               
175
                //Assert.That(status, Is.EqualTo(1));
173 176
            }
174 177
        }
175 178

  
ConvertService/ServiceBase/Markus.Service.DataBase.Test/DataBaseDocInfo.cs
14 14
            using (Markus.Service.DataBase.Repositories.ConvertDocRepository repository = new Repositories.ConvertDocRepository(ConnectionStr, dbtype)) {
15 15
                newConvertDocID = repository.CreateAsync(ProjectNo, docUri, "111111").GetAwaiter().GetResult();
16 16
                Console.WriteLine($"new id : {newConvertDocID}");
17
                Assert.Pass(newConvertDocID);
17 18
            }
18 19

  
19 20
            if (!string.IsNullOrEmpty(newConvertDocID)) {
......
22 23
                    var result = repository.CreateAsync(newConvertDocID, 10).GetAwaiter().GetResult();
23 24

  
24 25
                    Console.WriteLine($"new id : {result}");
26
                    Assert.Pass(result);
25 27
                }
26 28
            }
27 29
        }
ConvertService/ServiceBase/Markus.Service.DataBase.Test/DataBaseDocInfoPG.cs
15 15
            {
16 16
                newConvertDocID = repository.CreateAsync(ProjectNo, docUri, "111111").GetAwaiter().GetResult();
17 17
                Console.WriteLine($"new id : {newConvertDocID}");
18
                Assert.Pass(newConvertDocID);
18 19
            }
19 20

  
20 21
            if (!string.IsNullOrEmpty(newConvertDocID))
......
24 25
                    var result = repository.CreateAsync(newConvertDocID, 10).GetAwaiter().GetResult();
25 26

  
26 27
                    Console.WriteLine($"new id : {result}");
28
                    Assert.Pass(result);
27 29
                }
28 30
            }
29 31
        }
ConvertService/ServiceBase/Markus.Service.DataBase.Test/DataBaseDocPage.cs
15 15
            {
16 16
                newConvertDocID = repository.CreateAsync(ProjectNo, docUri, "111111").GetAwaiter().GetResult();
17 17
                Console.WriteLine($"new id : {newConvertDocID}");
18
                Assert.Pass(newConvertDocID);
18 19
            }
19 20

  
20 21
            if (!string.IsNullOrEmpty(newConvertDocID))
......
24 25
                    newDocInfo = repository.CreateAsync(newConvertDocID, 10).GetAwaiter().GetResult();
25 26

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

  
29 31

  
......
39 41
                        }
40 42

  
41 43
                        var result = repository.CreateAsync(pages).GetAwaiter().GetResult();
42

  
43
                        Console.WriteLine($"new id : {result}");
44
                        if (result)
45
                        {
46
                            Assert.Pass();
47
                        }
48
                        else
49
                        {
50
                            Assert.Fail();
51
                        }
44 52
                    }
45 53
                }
54
                else
55
                {
56
                    Assert.Fail();
57
                }
46 58
            }
47 59

  
48 60
        }
ConvertService/ServiceBase/Markus.Service.DataBase.Test/DataBaseDocPagePG.cs
16 16
            {
17 17
                newConvertDocID = repository.CreateAsync(ProjectNo, docUri, "111111").GetAwaiter().GetResult();
18 18
                Console.WriteLine($"new id : {newConvertDocID}");
19
                Assert.Pass(newConvertDocID);
19 20
            }
20 21

  
21 22
            if (!string.IsNullOrEmpty(newConvertDocID))
......
25 26
                    newDocInfo = repository.CreateAsync(newConvertDocID, 10).GetAwaiter().GetResult();
26 27

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

  
30 32

  
......
34 36
                    {
35 37
                        List<Entities.DOCPAGE> pages = new List<Entities.DOCPAGE>();
36 38

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

  
42
                        Stopwatch sw = new Stopwatch();
43

  
44
                        sw.Start();
45

  
46 44
                        var result = repository.CreateAsync(pages).GetAwaiter().GetResult();
47

  
48
                        
49
                        sw.Stop();
50

  
51
                        Console.WriteLine($"End Milliseconds id : {sw.ElapsedMilliseconds}");
52

  
45
                        if (result)
46
                        {
47
                            Assert.Pass();
48
                        }
49
                        else
50
                        {
51
                            Assert.Fail();
52
                        }
53 53
                    }
54 54
                }
55
                else
56
                {
57
                    Assert.Fail();
58
                }
55 59
            }
56 60

  
57 61
        }
ConvertService/ServiceBase/Markus.Service.DataBase.Test/DataBaseDocumentitem.cs
14 14
                var result = repository.GetFirstAsync("000000", "4000005").GetAwaiter().GetResult();
15 15

  
16 16
                Console.WriteLine($"new id : {result}");
17

  
18
                Assert.Pass(result.ID);
17 19
            }
18 20
        }
19 21

  
......
42 44
                var result = repository.CreateOrUPdateAsync(documentItem).GetAwaiter().GetResult();
43 45

  
44 46
                Console.WriteLine($"new id : {result}");
47
                Assert.Pass(result);
45 48
            }
46 49
        }
47 50
    }
ConvertService/ServiceBase/Markus.Service.DataBase.Test/DataBaseDocumentitemPG.cs
14 14
                var result = repository.GetFirstAsync("000000", "4000005").GetAwaiter().GetResult();
15 15

  
16 16
                Console.WriteLine($"new id : {result}");
17

  
18
                Assert.Pass(result.ID);
17 19
            }
18 20
        }
19 21

  
......
22 24
        {
23 25
            using (Markus.Service.DataBase.Repositories.DOCUMENTITEMRepository repository = new Repositories.DOCUMENTITEMRepository(ConnectionStr, dbtype))
24 26
            {
27

  
25 28
                var documentItem = new Entities.DOCUMENTITEM()
26
                {  
27
                    REVISION ="A",
28
                    DOCUMENT_NO= "PROC_TEST_DOCUMENT_NO",
29
                {
30
                    ID = "CC561E3CD580447E9A9508C563D257DA",
31
                    REVISION = "A",
32
                    DOCUMENT_NO = "PROC_TEST_DOCUMENT_NO",
29 33
                    DOCUMENT_NAME = "PROC_TEST_DOCUMENT_NAME",
30 34
                    GROUP_NO = "PROC_GROUP_NO",
31 35
                    ORIGINAL_FILE = "PROC_TEST_ORIGINAL_FILE",
32 36
                    DOCUMENT_ID = "0000000001",
33
                    RESULT_FILE= "PROC_RESULT_FILE",
37
                    RESULT_FILE = "PROC_RESULT_FILE",
34 38
                    RESULT = "PROC_RESULT",
35 39
                    PROJECT_NO = "PROC_RESULT",
36 40
                    Link = "PROC_TEST_Link"
......
40 44
                var result = repository.CreateOrUPdateAsync(documentItem).GetAwaiter().GetResult();
41 45

  
42 46
                Console.WriteLine($"new id : {result}");
47
                Assert.Pass(result);
43 48
            }
44 49
        }
45 50
    }
ConvertService/ServiceBase/Markus.Service.DataBase.Test/DataBaseServiceproperties.cs
22 22

  
23 23
                foreach (var serviceproperty in sERVICEPROPERTIEs) {
24 24
                    Console.WriteLine($"ID : {serviceproperty.ID}");
25
                    Assert.Pass(serviceproperty.ID.ToString());
25 26
                    break;
26 27
                }
27 28
            }
......
40 41
                if(serviceDatas.Count> 0) {
41 42
                    var serviceproperty = repository.GetSingleAsync(serviceDatas[0].ID).GetAwaiter().GetResult();
42 43
                    Console.WriteLine($"ID : {serviceproperty.ID}");
44
                    Assert.Pass(serviceproperty.ID);
43 45
                }
44 46
            }
45 47
        }
ConvertService/ServiceBase/Markus.Service.DataBase.Test/DataBaseServicepropertiesPG.cs
1 1
using Dapper;
2
using Markus.Service.DataBase.Entities;
2 3
using NUnit.Framework;
3 4
using System;
4 5
using System.Collections.Generic;
......
23 24
                foreach (var serviceproperty in sERVICEPROPERTIEs)
24 25
                {
25 26
                    Console.WriteLine($"ID : {serviceproperty.ID}");
27
                    Assert.Pass(serviceproperty.ID.ToString());
26 28
                    break;
27 29
                }
28 30
            }
......
42 44
                {
43 45
                    var serviceproperty = repository.GetSingleAsync(serviceDatas[0].ID).GetAwaiter().GetResult();
44 46
                    Console.WriteLine($"ID : {serviceproperty.ID}");
47
                    Assert.Pass(serviceproperty.ID);
45 48
                }
46 49
            }
47 50
        }

내보내기 Unified diff

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