프로젝트

일반

사용자정보

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

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

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

1
using Dapper;
2
using Markus.Service.DataBase.Entities;
3
using NUnit.Framework;
4
using System;
5
using System.Collections.Generic;
6

    
7
namespace Markus.Service.DataBase.Test
8
{
9
    /// <summary>
10
    /// PostgreSQL
11
    /// </summary>
12
    public class DataBaseServicepropertiesPG : TestBasePG
13
    {
14
        /// <summary>
15
        /// Get SERVICE_PROPERTIES
16
        /// </summary>
17
        [Test, Description("SERVICEPROPERTIES")]
18
        public void GetServiceProperties()
19
        {
20
            using (Markus.Service.DataBase.Repositories.SERVICEPROPERTIESRepository repository = new Repositories.SERVICEPROPERTIESRepository(ConnectionStr, dbtype))
21
            {
22
                var sERVICEPROPERTIEs = repository.GetAsync().GetAwaiter().GetResult();
23

    
24
                foreach (var serviceproperty in sERVICEPROPERTIEs)
25
                {
26
                    Console.WriteLine($"ID : {serviceproperty.ID}");
27
                    Assert.Pass(serviceproperty.ID.ToString());
28
                    break;
29
                }
30
            }
31
        }
32

    
33
        /// <summary>
34
        /// Get SERVICE_PROPERTY
35
        /// </summary>
36
        [Test, Description("SERVICE_PROPERTY")]
37
        public void GetServiceProperty()
38
        {
39
            using (Markus.Service.DataBase.Repositories.SERVICEPROPERTIESRepository repository = new Repositories.SERVICEPROPERTIESRepository(ConnectionStr, dbtype))
40
            {
41
                var serviceDatas = repository.GetAsync().GetAwaiter().GetResult();
42

    
43
                if (serviceDatas.Count > 0)
44
                {
45
                    var serviceproperty = repository.GetSingleAsync(serviceDatas[0].ID).GetAwaiter().GetResult();
46
                    Console.WriteLine($"ID : {serviceproperty.ID}");
47
                    Assert.Pass(serviceproperty.ID);
48
                }
49
            }
50
        }
51
    }
52
}
클립보드 이미지 추가 (최대 크기: 500 MB)