private void ApplicantJobApplication_D_Test()
        {
            var client = new ApplicantJobApplication.ApplicantJobApplicationClient(_channel);

            ApplicantJobApplicationProto proto = client.GetApplicantJobApplication(new ApplicantJobApplicationKey()
            {
                Id = _applicantJobApplication.Id.ToString()
            });
            ApplicantJobApplicationList protos = new ApplicantJobApplicationList();

            protos.Items.Add(proto);
            client.DeleteApplicantJobApplication(protos);
            proto = null;
            try
            {
                proto = client.GetApplicantJobApplication(new ApplicantJobApplicationKey()
                {
                    Id = _applicantJobApplication.Id.ToString()
                });
            }
            catch (RpcException)
            {
            }
            Assert.IsNull(proto);
        }
        private void ApplicantJobApplication_CRU_Test()
        {
            var client = new ApplicantJobApplication.ApplicantJobApplicationClient(_channel);
            // add
            ApplicantJobApplicationProto proto  = ProtoMapper.MapFromApplicantJobApplicationPoco(_applicantJobApplication);
            ApplicantJobApplicationList  protos = new ApplicantJobApplicationList();

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

            proto = CheckGetApplicantJobApplication(client, new ApplicantJobApplicationKey()
            {
                Id = proto.Id
            }, proto);

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

            // check update
            proto.ApplicationDate = ConvertDateTime2TimeStamp(Faker.Date.Recent());

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

            CheckGetApplicantJobApplication(client, new ApplicantJobApplicationKey()
            {
                Id = proto.Id
            }, proto);
        }
        private ApplicantJobApplicationProto CheckGetApplicantJobApplication(ApplicantJobApplication.ApplicantJobApplicationClient client
                                                                             , ApplicantJobApplicationKey key, ApplicantJobApplicationProto compare = null)
        {
            ApplicantJobApplicationProto proto = null;

            try
            {
                proto = client.GetApplicantJobApplication(key);
            }
            catch (RpcException)
            {
                Assert.Fail();
            }
            Assert.IsNotNull(proto);
            Assert.AreEqual(proto.Id, key.Id);
            if (compare != null)
            {
                Assert.AreEqual(proto.Applicant, compare.Applicant);
                Assert.AreEqual(proto.Job, compare.Job);
                Assert.AreEqual(proto.ApplicationDate.ToDateTime().Date, compare.ApplicationDate.ToDateTime().Date);
            }
            return(proto);
        }