private void CompanyJobEducation_D_Test()
        {
            var client = new CompanyJobEducation.CompanyJobEducationClient(_channel);

            CompanyJobEducationProto proto = client.GetCompanyJobEducation(new CompanyJobEducationKey()
            {
                Id = _companyJobEducation.Id.ToString()
            });
            CompanyJobEducationList protos = new CompanyJobEducationList();

            protos.Items.Add(proto);
            client.DeleteCompanyJobEducation(protos);
            proto = null;
            try
            {
                proto = client.GetCompanyJobEducation(new CompanyJobEducationKey()
                {
                    Id = _companyJobEducation.Id.ToString()
                });
            }
            catch (RpcException)
            {
            }
            Assert.IsNull(proto);
        }
        private void CompanyJobEducation_CRU_Test()
        {
            var client = new CompanyJobEducation.CompanyJobEducationClient(_channel);
            // add
            CompanyJobEducationProto proto  = ProtoMapper.MapFromCompanyJobEducationPoco(_companyJobEducation);
            CompanyJobEducationList  protos = new CompanyJobEducationList();

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

            proto = CheckGetCompanyJobEducation(client, new CompanyJobEducationKey()
            {
                Id = proto.Id
            }, proto);

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

            // check update
            proto.Importance = 1;
            proto.Major      = Truncate(Faker.Lorem.Sentence(), 100);

            protos = new CompanyJobEducationList();
            protos.Items.Add(proto);
            client.UpdateCompanyJobEducation(protos);

            CheckGetCompanyJobEducation(client, new CompanyJobEducationKey()
            {
                Id = proto.Id
            }, proto);
        }
示例#3
0
        public override Task <Empty> DeleteCompanyJobEducation(CompanyJobEducationList request, ServerCallContext context)
        {
            List <CompanyJobEducationPoco> pocos = new List <CompanyJobEducationPoco>();

            foreach (var item in request.CompJobEdus)
            {
                pocos.Add(ToPoco(item));
            }
            logic.Delete(pocos.ToArray());
            return(Task.FromResult(new Empty()));
        }
示例#4
0
        public override Task <CompanyJobEducationList> GetAllCompanyJobEducation(Empty request, ServerCallContext context)
        {
            CompanyJobEducationList        list  = new CompanyJobEducationList();
            List <CompanyJobEducationPoco> pocos = logic.GetAll();

            foreach (var poco in pocos)
            {
                list.CompJobEdus.Add(FromPoco(poco));
            }
            return(Task.FromResult(list));
        }