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); }
public override Task <Empty> DeleteApplicantProfile(ApplicantProfileList request, ServerCallContext context) { List <ApplicantProfilePoco> pocos = new List <ApplicantProfilePoco>(); foreach (var item in request.AppProfiles) { pocos.Add(ToPoco(item)); } logic.Delete(pocos.ToArray()); return(Task.FromResult(new Empty())); }
public override Task <ApplicantProfileList> GetAllApplicantProfile(Empty request, ServerCallContext context) { ApplicantProfileList list = new ApplicantProfileList(); List <ApplicantProfilePoco> pocos = logic.GetAll(); foreach (var poco in pocos) { list.AppProfiles.Add(FromPoco(poco)); } return(Task.FromResult(list)); }
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); }