private MilitaryInfo BuildMilitaryInfo() { var personalNumber = new Code(_secondCardGroup.MilitaryDocumentCard.PersonalNumber); var billetNumber = new Code(_secondCardGroup.MilitaryDocumentCard.MilitaryBilletCode); SecretAccess secretAccess = null; if (_secondCardGroup.MilitaryDocumentCard.IsHaveSecretAccess) { var accessForm = _secondCardGroup.MilitaryDocumentCard.AccessForm.ToAccessFormEnum(); var number = _secondCardGroup.MilitaryDocumentCard.SecretAccessNumber; if (!_secondCardGroup.MilitaryDocumentCard.SecretAccessIssueDate.HasValue) { throw new NullReferenceException(nameof(_secondCardGroup.MilitaryDocumentCard.SecretAccessIssueDate)); } secretAccess = new SecretAccess(accessForm, number, _secondCardGroup.MilitaryDocumentCard.SecretAccessIssueDate.Value); } var militaryBillet = new MilitaryBillet(billetNumber, secretAccess); var proficiencyCategory = _secondCardGroup.ProficiencyCard.ProficiencyCategory.ToProficiencyCategoryEnum(); var officialStatus = _secondCardGroup.ProficiencyCard.OfficialStatus.ToOfficialStatusEnum(); var nervously = _secondCardGroup.ProficiencyCard.NervouslyPsychologicalStability.ToNervouslyPsychologicalStatusEnum(); var general = _secondCardGroup.ProficiencyCard.GeneralPsychologicalStability.ToGeneralPsychologicalStatusEnum(); var proficiencyCard = new ProficiencyCardInfo(proficiencyCategory, officialStatus, nervously, general); var speciality = _secondCardGroup.DistributionCard.Speciality; var teamMode = _secondCardGroup.DistributionCard.TeamMode; return(new MilitaryInfo(personalNumber, militaryBillet, proficiencyCard, speciality, teamMode)); }
public void MilitaryProficiencyCardTest() { var proficiencyCategory = ProficiencyCategory.Second; var officialStatus = OfficialStatus.Driver; var nervously = NervouslyPsychologicalStatus.Satisfactory; var general = GeneralPsychologicalStatus.High; var proficiencyCard = new ProficiencyCardInfo(proficiencyCategory, officialStatus, nervously, general); Assert.AreEqual(proficiencyCategory, proficiencyCard.ProficiencyCategory); Assert.AreEqual(officialStatus, proficiencyCard.OfficialStatus); Assert.AreEqual(general, proficiencyCard.GeneralPsychologicalStability); Assert.AreEqual(nervously, proficiencyCard.NervouslyPsychologicalStability); }
private MilitaryInfo BuildMilitaryInfo() { var personalNumber = new Code("ВС 052572"); var billetNumber = new Code("АН 2281488"); var accessForm = AccessForm.First; var number = "1488"; var issueDate = new DateTime(2017, 1, 1); var secretAccess = new SecretAccess(accessForm, number, issueDate); var militaryBillet = new MilitaryBillet(billetNumber, secretAccess); var proficiencyCategory = ProficiencyCategory.Second; var officialStatus = OfficialStatus.Driver; var nervously = NervouslyPsychologicalStatus.Satisfactory; var general = GeneralPsychologicalStatus.High; var proficiencyCard = new ProficiencyCardInfo(proficiencyCategory, officialStatus, nervously, general); var speciality = MilitaryInfo.NoSpeciality; var teamMode = "К-220А"; return(new MilitaryInfo(personalNumber, militaryBillet, proficiencyCard, speciality, teamMode)); }
private static MilitaryInfo BuildMilitaryInfo(priz priz) { var personalNumber = new Code(priz.l_n); var biletNumber = new Code(priz.v_b); var secretAccess = BuildSecretAccess(priz); var militaryBilet = new MilitaryBillet(biletNumber, secretAccess); var card = new ProficiencyCardInfo(proficiencyCategory: priz.ppo.ToProficiencyCategoryEnum(), officialstatus: priz.pp_appointment.ToOfficialStatusEnum(), nervously: priz.npu.ToNervouslyPsychologicalStatusEnum(), general: priz.ops.ToGeneralPsychologicalStatusEnum()); var speciality = !string.IsNullOrWhiteSpace(priz.vus_va) ? priz.vus_va : MilitaryInfo.NoSpeciality; var teamMode = !string.IsNullOrWhiteSpace(priz.destination) ? priz.destination : MilitaryInfo.NoTeamMode; return(new MilitaryInfo(personalNumber, militaryBilet, card, speciality, teamMode)); }
public void MilitaryInfoTest() { var personalNumber = new Code("ВС 052572"); var billetNumber = new Code("АН 2281488"); var accessForm = AccessForm.First; var number = "1488"; var issueDate = new DateTime(2017, 1, 1); var secretAccess = new SecretAccess(accessForm, number, issueDate); var militaryBillet = new MilitaryBillet(billetNumber, secretAccess); var proficiencyCategory = ProficiencyCategory.Second; var officialStatus = OfficialStatus.Driver; var nervously = NervouslyPsychologicalStatus.Satisfactory; var general = GeneralPsychologicalStatus.High; var proficiencyCard = new ProficiencyCardInfo(proficiencyCategory, officialStatus, nervously, general); var speciality = MilitaryInfo.NoSpeciality; var teamMode = "К-220А"; var militaryInfo = new MilitaryInfo(personalNumber, militaryBillet, proficiencyCard, speciality, teamMode); Assert.AreEqual(personalNumber, militaryInfo.PersonalNumber); Assert.AreEqual(billetNumber, militaryInfo.Billet.BilletNumber); Assert.IsTrue(militaryInfo.Billet.IsHaveSecretAccess); Assert.AreEqual(accessForm, militaryInfo.Billet.SecretAccess.AccessForm); Assert.AreEqual(number, militaryInfo.Billet.SecretAccess.SecretAccessNumber); Assert.AreEqual(issueDate, militaryInfo.Billet.SecretAccess.IssueDate); Assert.AreEqual(proficiencyCategory, militaryInfo.ProficiencyCard.ProficiencyCategory); Assert.AreEqual(officialStatus, militaryInfo.ProficiencyCard.OfficialStatus); Assert.AreEqual(general, militaryInfo.ProficiencyCard.GeneralPsychologicalStability); Assert.AreEqual(nervously, militaryInfo.ProficiencyCard.NervouslyPsychologicalStability); Assert.AreEqual(speciality, militaryInfo.Speciality); Assert.AreEqual(teamMode, militaryInfo.TeamMode); }