Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
2.2 kB
2
Indexable
Never
public function initIncorrectlyTypedData() {

    _exposure = ExposureMother.Complete

    var bundle = _exposure.Bundle

    var completeDocPack = new CompleteDocPack_Toi(_exposure)
    completeDocPack.Exposure = _exposure
    completeDocPack.PackagePattern.IsForOriginal = true
    completeDocPack.PackagePattern = DocPackPattern_ToiMother.DefaultKSK
    _exposure.addToCompleteDocPacks_Toi(completeDocPack)

    var claimAdditional = new ClaimAdditional_ToiBuilder()
        .withCustomerAppVersion(99.99bd)
        .withCustomerDevicePlatform(DevicePlatformType_Toi.TC_ANDROID)  // todo diversificate
        .create(bundle)
    completeDocPack.Exposure.Claim.ClaimAdditional_Toi = claimAdditional

    var document = DocumentMother.complete(DocumentType.TC_DRIVER_LICENSE_TOI, _exposure.Claim).create(bundle)
    document.Name = "Valid name"
    document.Exposure = Exposure
    document.IsNeedTyping_Toi = false

    var requestsToDocuments = new RequestsToDocuments_Toi(_exposure)
    requestsToDocuments.Document = document

    var relatedDoc = new DocForCompleteDocPack_Toi(_exposure)
    relatedDoc.IsMandatory = true
    relatedDoc.DocumentTypeInfo.DocumentType = DocumentType.TC_ASSIGNMENTCONTRACT_TOI  // todo incapsulate
    completeDocPack.addToRelatedDocs(relatedDoc)

    var docIteration = new RequestDocIteration_Toi(_exposure)
    docIteration.Exposure = _exposure
    docIteration.IterationNumber = 777

    var requestDoc = new RequestDoc_Toi(_exposure)
    requestDoc.IsForOriginal = true
    requestDoc.DocumentType = DocumentType.TC_C_ORDER_TOI
    requestDoc.Document = DocumentMother.complete(DocumentType.TC_ACCEPTDOC1_TOI, _exposure.Claim).create(bundle)
    requestDoc.Document.IsNeedTyping_Toi = false
    requestDoc.Document.Name = "Valid name!!"
    requestDoc.Document.Exposure = _exposure
    docIteration.addToRequestDocs(requestDoc)

    var requestDocAdditional = new RequestDocAdditional_Toi(_exposure)
    requestDocAdditional.DocumentType = DocumentType.TC_CONSIDERATION_ACCEPTANCE_TOI
    docIteration.addToRequestDocAdditionals(requestDocAdditional)

    requestsToDocuments.RequestDocAdditional = requestDocAdditional

    bundle.commit()
  }