コード例 #1
0
ファイル: UsecaseTest.cs プロジェクト: bennyjonsson/abou
        public void GetAllUsersFromSBK_02()
        {
            var config = new Config()
            {
                Name             = "internsbk",
                ApiUrl           = "https://testservice.MINKOMMUN.se/api/v2/services",
                ApiUserName      = "******",
                ApiKey           = "c0ff3c0f-fec0-ff3c-0ffe-c0ff3c0ff3c0f",
                ServiceShortName = "SBK_02",
                Actor            = "SBK"
            };

            var api = new AbouRestApi(config);


            DateTime FromDate = new DateTime(2016, 02, 27);
            DateTime ToDate   = new DateTime(2019, 12, 11);

            string[] States = new string[] { "Godkänd", "Inkommet" };
            bool     ExcludeCasesWithDiaryNumber = false;

            var users = new ConcurrentBag <string>();

            var res = api.GetByDateAndState(FromDate, ToDate, States, ExcludeCasesWithDiaryNumber);

            Parallel.ForEach(res, (u) =>
            {
                var r    = api.GetDetailed(u);
                var user = r.Signatures.First().UserIdentity;
                users.Add(user);
            });

            var f = string.Join(",", users.Distinct());
        }
コード例 #2
0
        public void GetDetailed_GivenDataGetDetailedUniqueIdReturnsResultWithSameId()
        {
            var config = Global.GetConfig;
            var api    = new AbouRestApi(config);
            var data   = new DataGetDetailed(config)
            {
                UniqueId = "190227-BSF_10-GC95"
            };
            DetailedResult detailedResult = api.GetDetailed(data);

            Assert.Equal(data.UniqueId, detailedResult.Id);
        }