private void ApplicantEducation_D_Test()
        {
            var client = new ApplicantEducation.ApplicantEducationClient(_channel);

            ApplicantEducationProto proto = client.GetApplicantEducation(new ApplicantEducationKey()
            {
                Id = _applicantEducation.Id.ToString()
            });
            ApplicantEducationList protos = new ApplicantEducationList();

            protos.Items.Add(proto);
            client.DeleteApplicantEducation(protos);
            proto = null;
            try
            {
                proto = client.GetApplicantEducation(new ApplicantEducationKey()
                {
                    Id = _applicantEducation.Id.ToString()
                });
            }
            catch (RpcException)
            {
            }
            Assert.IsNull(proto);
        }
Пример #2
0
        public override Task <Empty> DeleteApplicantEducation(ApplicantEducationList request, ServerCallContext context)
        {
            List <ApplicantEducationPoco> pocos = new List <ApplicantEducationPoco>();

            foreach (var item in request.AppEdus)
            {
                pocos.Add(ToPoco(item));
            }
            logic.Delete(pocos.ToArray());
            return(Task.FromResult(new Empty()));
        }
Пример #3
0
        public override Task <ApplicantEducationList> GetAllApplicantEducation(Empty request, ServerCallContext context)
        {
            ApplicantEducationList        list  = new ApplicantEducationList();
            List <ApplicantEducationPoco> pocos = logic.GetAll();

            foreach (var poco in pocos)
            {
                list.AppEdus.Add(FromPoco(poco));
            }
            return(Task.FromResult(list));
        }
        private void ApplicantEducation_CRU_Test()
        {
            var client = new ApplicantEducation.ApplicantEducationClient(_channel);
            // add
            ApplicantEducationProto proto  = ProtoMapper.MapFromApplicantEducationPoco(_applicantEducation);
            ApplicantEducationList  protos = new ApplicantEducationList();

            protos.Items.Add(proto);
            client.AddApplicantEducation(protos);

            proto = CheckGetApplicantEducation(client, new ApplicantEducationKey()
            {
                Id = proto.Id
            }, proto);

            // check List
            protos = client.GetApplicantEducations(new Empty());
            Assert.IsTrue(protos.Items.Count > 0);

            // check update
            proto.Major = Faker.Education.Major();
            proto.CertificateDiploma = Faker.Education.Major();
            proto.StartDate          = ConvertDateTime2TimeStamp(Faker.Date.Past(3));
            proto.CompletionDate     = ConvertDateTime2TimeStamp(Faker.Date.Forward(1));

            proto.CompletionPercent = (byte)Faker.Number.RandomNumber(1);

            protos = new ApplicantEducationList();
            protos.Items.Add(proto);
            client.UpdateApplicantEducation(protos); // e9261fa9-f0c3-4603-b400-63a5f26952c7

            CheckGetApplicantEducation(client, new ApplicantEducationKey()
            {
                Id = proto.Id
            }, proto);
        }