private void AttorneyFieldsDontHaveErrors(VipAttorneyRecognizedTrustScreenModel trust) { var fields = trust.Fields.Where(x => x.Parent == trust.RecognizedAttorney); #region Assertions Check.That(fields.Any()); #endregion fields.ForEach(f => Assert.That(f.ErrorLevel, Is.EqualTo(ErrorLevel.Valid))); }
private bool DocumentNumbersDontMatch(VipAttorneyRecognizedTrustScreenModel model) { var physAttorney = model.RecognizedAttorney as PhysicalPerson; var physBoxAttorney = model.VipAttorney.Value.Attorney.PersonInfo as PhysicalPersonInfo; if (physAttorney != null && physBoxAttorney != null) { return(physAttorney.DocumentNumber.Value != physBoxAttorney.DocumentNumber); } return(false); }
private void AttorneyFieldsHaveErrorWithText(VipAttorneyRecognizedTrustScreenModel trust, string expectedErrorTextForAttorneyFields) { var fields = trust.Fields.Where(x => x.Parent == trust.RecognizedAttorney); #region Assertions Check.That(fields.Any()); #endregion fields.ForEach(f => Assert.That(f.ErrorLevel, Is.EqualTo(ErrorLevel.Error))); fields.ForEach(f => Assert.That(f.ErrorText, Is.EqualTo(expectedErrorTextForAttorneyFields))); }
private void ValidateAttorney(VipAttorneyRecognizedTrustScreenModel model) { if (model.VipAttorney.Value == null || (!model.VipAttorneyWasManuallySet && (model.RecognizedAttorney.ResultName != model.VipAttorney.Value.Attorney.PersonInfo.Name || DocumentNumbersDontMatch(model)) )) { model.RecognizedAttorney.Fields.ForEach(f => { f.ErrorLevel = ErrorLevel.Error; f.ErrorText = "Распознанный представитель не совпадает с ожидаемым" + (model.VipAttorney != null ? " (" + model.VipAttorney.Value.Attorney.PersonInfo.Name + ")" : ""); }); } }
protected void Validate(VipAttorneyRecognizedTrustScreenModel trust) { _trustValidator.ValidateEditorModel(trust); }
private static void ValidateDateAndSignatureFields(VipAttorneyRecognizedTrustScreenModel trust) { ValidateDateFields(trust); SignatureFieldsMustBePresent(trust); }
private void ValidateEditorModel1(VipAttorneyRecognizedTrustScreenModel model) { ResetFields(model); ValidateDateAndSignatureFields(model); ValidateAttorney(model); }
private static void SignatureFieldsMustBePresent(VipAttorneyRecognizedTrustScreenModel trust) { ValidateMandatoryBoolField(trust.TrusterSignature, "Отсутвствует подпись доверителя."); ValidateMandatoryBoolField(trust.CertifierSignature, "Отсутвствует подпись удостоверителя."); ValidateMandatoryBoolField(trust.CertifierStamp, "Отсутвствует печать удостоверителя."); }
public void ValidateMainTrustFields(VipAttorneyRecognizedTrustScreenModel trust) { ResetFields(trust); ValidateDateAndSignatureFields(trust); }