Пример #1
0
        public async Task GetPhaseEntry()
        {
            // create request
            var builer = GetPhaseEntryRequest.Builder();

            builer.AddResource((int)ResourceId.Client)
            .AddParentId(10063)
            //.AppendField("Phase.P_Id")
            .AppendField("Phase.P_Phase")
            //.AppendField("Phase.P_PhaseDate")
            //.AppendField("Phase.P_PhaseMemo")
            //.AppendField("Phase.P_UpdateDate")
            //.AppendField("Phase.P_UpdateId")
            .AppendField("Phase.flag");
            var request = builer.Build().Content;

            //Get session
            using (var client = PrivateClient.CreateClient(new PrivateServerSettings()
            {
                ServerUrl = server, LoggerFactory = TestLoggerFactoryAttribute.CurrentLoggerFactory
            }))
                using (var session = client.CreateSession(auth))
                {
                    //Send Request
                    var entries = await session.CallAsync(builer.Build());

                    Assert.That(entries, Is.Not.Null, "Flow is null!");
                    Assert.That(entries.PhaseEntryList, Is.Not.Null, "Flow is null!");
                    Assert.That(entries.PhaseEntryList.First().Id, Is.Not.Null, "Flow is null!");
                }
        }
Пример #2
0
        private static Dictionary <object, GetPhaseEntryRequest.IBuilderWithData> initPhaseEntryReader(HrbcRecordCreator.IRecordEntries recordData)
        {
            Dictionary <object, GetPhaseEntryRequest.IBuilderWithData> result = new Dictionary <object, GetPhaseEntryRequest.IBuilderWithData>();

            foreach (var key in recordData.Keys.Where(key => recordData[key].ResourceType != Enums.ResourceType.Contract))
            {
                var builder = GetPhaseEntryRequest.Builder();
                builder.AddResource((int)recordData[key].ResourceType).AddParentId(recordData[key].Id.ToString()).AppendField("Phase.flag").AppendField("Phase.P_Phase").AppendField("Phase.P_PhaseMemo").AppendField("Phase.P_PhaseDate").AppendField("Phase.P_UpdateDate").AppendField("Phase.P_UpdateId");
                result.Add(key, builder);
            }
            return(result);
        }
Пример #3
0
        private Dictionary <object, GetPhaseEntryRequest.IBuilderWithData> InitPhaseEntryReader()
        {
            Dictionary <object, GetPhaseEntryRequest.IBuilderWithData> result = new Dictionary <object, GetPhaseEntryRequest.IBuilderWithData>();

            foreach (var key in records.Data.Keys.Where(key => records.Data[key].ResourceType != ResourceType.Contract))
            {
                var builder = GetPhaseEntryRequest.Builder();
                builder.AddResource((int)records.Data[key].ResourceType).AddParentId(records.Data[key].Id.ToString()).AppendField("Phase.flag").AppendField("Phase.P_Phase");
                result.Add(key, builder);
            }
            return(result);
        }
Пример #4
0
        /// <summary>
        /// Before Test
        /// </summary>
        /// <param name="key">Resource record Key</param>
        /// <param name="resourceId">Resource Type</param>
        /// <param name="parentId">Record Id</param>
        /// <param name="fields">Phase's fields</param>
        /// <param name="ids">Phase's ids</param>
        /// <returns></returns>
        internal static Func <ISession <PrivateAuthentication>, ITest, Task <IReadOnlyDictionary <object, List <PhaseEntryContent> > > > ReadPhases(object key, ResourceId resourceId, ulong parentId, List <string> fields, List <string> ids)
        {
            return(async(session, test) =>
            {
                Dictionary <object, List <PhaseEntryContent> > resultData = new Dictionary <object, List <PhaseEntryContent> >();
                var requestBuilder = GetPhaseEntryRequest.Builder();
                requestBuilder.AddResource((int)resourceId).AddParentId(parentId.ToString()).AddFields(fields).AddIds(ids);
                GetPhaseEntryResponse entries = await session.CallAsync(requestBuilder);

                resultData.Add(key, entries.PhaseEntryList);
                return resultData;
            });
        }
Пример #5
0
        private Dictionary <object, GetPhaseEntryRequest.IBuilderWithData> InitPhaseReader()
        {
            Dictionary <object, GetPhaseEntryRequest.IBuilderWithData> result = new Dictionary <object, GetPhaseEntryRequest.IBuilderWithData>();

            string[] phaseEntryFields = new string[] { "Phase.P_PhaseDate", "Phase.P_Phase", "Phase.P_UpdateId", "Phase.P_Id", "Phase.flag" };
            foreach (var item in updatingRequestRecords.Data)
            {
                if (item.Value.ResourceType != Enums.ResourceType.Contract)
                {
                    result.Add(item.Key, GetPhaseEntryRequest.Builder()
                               .AddFields(phaseEntryFields)
                               .AddResource((int)item.Value.ResourceType)
                               .AddParentId(Convert.ToInt32(item.Value.Id)));
                }
            }
            return(result);
        }