private void ApplicantProfile_D_Test()
        {
            var client = new ApplicantProfile.ApplicantProfileClient(_channel);

            ApplicantProfileProto proto = client.GetApplicantProfile(new ApplicantProfileKey()
            {
                Id = _applicantProfile.Id.ToString()
            });
            ApplicantProfileList protos = new ApplicantProfileList();

            protos.Items.Add(proto);
            client.DeleteApplicantProfile(protos);
            proto = null;
            try
            {
                proto = client.GetApplicantProfile(new ApplicantProfileKey()
                {
                    Id = _applicantProfile.Id.ToString()
                });
            }
            catch (RpcException)
            {
            }
            Assert.IsNull(proto);
        }
        private ApplicantProfileProto CheckGetApplicantProfile(ApplicantProfile.ApplicantProfileClient client
                                                               , ApplicantProfileKey key, ApplicantProfileProto compare = null)
        {
            ApplicantProfileProto proto = null;

            try
            {
                proto = client.GetApplicantProfile(key);
            }
            catch (RpcException)
            {
                Assert.Fail();
            }
            Assert.IsNotNull(proto);
            Assert.AreEqual(proto.Id, key.Id);
            if (compare != null)
            {
                Assert.AreEqual(proto.Login, compare.Login);
                Assert.AreEqual(proto.CurrentSalary, compare.CurrentSalary);
                Assert.AreEqual(proto.CurrentRate, compare.CurrentRate);
                Assert.AreEqual(proto.Currency, compare.Currency);
                Assert.AreEqual(proto.Country, compare.Country);
                Assert.AreEqual(proto.Province, compare.Province);
                Assert.AreEqual(proto.Street, compare.Street);
                Assert.AreEqual(proto.City, compare.City);
                Assert.AreEqual(proto.PostalCode, compare.PostalCode);
            }
            return(proto);
        }
        private void ApplicantProfile_CRU_Test()
        {
            var client = new ApplicantProfile.ApplicantProfileClient(_channel);
            // add
            ApplicantProfileProto proto  = ProtoMapper.MapFromApplicantProfilePoco(_applicantProfile);
            ApplicantProfileList  protos = new ApplicantProfileList();

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

            proto = CheckGetApplicantProfile(client, new ApplicantProfileKey()
            {
                Id = proto.Id
            }, proto);

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

            // check update
            proto.City          = Faker.Address.CityPrefix();
            proto.Currency      = "US".PadRight(10);
            proto.CurrentRate   = proto.CurrentRate.ConvertFrom(61.25M);
            proto.CurrentSalary = proto.CurrentSalary.ConvertFrom(77500);
            proto.Province      = Truncate(Faker.Address.Province(), 10).PadRight(10);
            proto.Street        = Truncate(Faker.Address.StreetName(), 100);
            proto.PostalCode    = Truncate(Faker.Address.CanadianZipCode(), 20).PadRight(20);

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

            CheckGetApplicantProfile(client, new ApplicantProfileKey()
            {
                Id = proto.Id
            }, proto);
        }