diff --git a/src/Apps/W1/DataSearch/App/DataSearch.page.al b/src/Apps/W1/DataSearch/App/DataSearch.page.al index f8294b29b7..54aec6a33d 100644 --- a/src/Apps/W1/DataSearch/App/DataSearch.page.al +++ b/src/Apps/W1/DataSearch/App/DataSearch.page.al @@ -133,9 +133,9 @@ page 2680 "Data Search" [TryFunction] local procedure ValidateFilter(FilterValue: text) var - DataSearchResultFilterTest: Record "Data Search Result"; + TempDataSearchResultFilterTest: Record "Data Search Result"; begin - DataSearchResultFilterTest.SetFilter(Description, '*' + FilterValue + '*'); // will throw an error if filter is illegal + TempDataSearchResultFilterTest.SetFilter(Description, '*' + FilterValue + '*'); // will throw an error if filter is illegal end; internal procedure LaunchSearch() diff --git a/src/Apps/W1/DataSearch/App/DataSearchResultRecords.page.al b/src/Apps/W1/DataSearch/App/DataSearchResultRecords.page.al index 7d4cca7aa1..eb4d14457a 100644 --- a/src/Apps/W1/DataSearch/App/DataSearchResultRecords.page.al +++ b/src/Apps/W1/DataSearch/App/DataSearchResultRecords.page.al @@ -394,9 +394,9 @@ page 2682 "Data Search Result Records" local procedure DrillDown() var - DataSearchResult: Record "Data Search Result"; + TempDataSearchResult: Record "Data Search Result"; begin - DataSearchResult.ShowPage(SourceRecRef); + TempDataSearchResult.ShowPage(SourceRecRef); end; local procedure AdjustColumnOffset(Delta: Integer) diff --git a/src/Apps/W1/DataSearch/App/DataSearchSetupTable.Table.al b/src/Apps/W1/DataSearch/App/DataSearchSetupTable.Table.al index be20db2555..3b0fe40d3b 100644 --- a/src/Apps/W1/DataSearch/App/DataSearchSetupTable.Table.al +++ b/src/Apps/W1/DataSearch/App/DataSearchSetupTable.Table.al @@ -142,11 +142,11 @@ table 2681 "Data Search Setup (Table)" internal procedure GetProfileID(): Code[30] var - UserSettingsRec: Record "User Settings"; + TempUserSettingsRec: Record "User Settings"; UserSettings: Codeunit "User Settings"; begin - UserSettings.GetUserSettings(UserSecurityId(), UserSettingsRec); - exit(UserSettingsRec."Profile ID"); + UserSettings.GetUserSettings(UserSecurityId(), TempUserSettingsRec); + exit(TempUserSettingsRec."Profile ID"); end; procedure GetRoleCenterID(): Integer diff --git a/src/Apps/W1/EDocument/App/src/Document/EDocument.Page.al b/src/Apps/W1/EDocument/App/src/Document/EDocument.Page.al index 2de7f2a557..3e2f8ea79b 100644 --- a/src/Apps/W1/EDocument/App/src/Document/EDocument.Page.al +++ b/src/Apps/W1/EDocument/App/src/Document/EDocument.Page.al @@ -342,12 +342,12 @@ page 6121 "E-Document" trigger OnAction() var - EDocImportParameters: Record "E-Doc. Import Parameters"; + TempEDocImportParameters: Record "E-Doc. Import Parameters"; begin - EDocImportParameters."Step to Run" := "Import E-Document Steps"::"Finish draft"; - EDocImportParameters."Purch. Journal V1 Behavior" := EDocImportParameters."Purch. Journal V1 Behavior"::"Create purchase document"; - EDocImportParameters."Create Document V1 Behavior" := true; - EDocImport.ProcessIncomingEDocument(Rec, EDocImportParameters); + TempEDocImportParameters."Step to Run" := "Import E-Document Steps"::"Finish draft"; + TempEDocImportParameters."Purch. Journal V1 Behavior" := TempEDocImportParameters."Purch. Journal V1 Behavior"::"Create purchase document"; + TempEDocImportParameters."Create Document V1 Behavior" := true; + EDocImport.ProcessIncomingEDocument(Rec, TempEDocImportParameters); if EDocumentErrorHelper.HasErrors(Rec) then Message(DocNotCreatedMsg, Rec."Document Type"); end; @@ -361,12 +361,12 @@ page 6121 "E-Document" trigger OnAction() var - EDocImportParameters: Record "E-Doc. Import Parameters"; + TempEDocImportParameters: Record "E-Doc. Import Parameters"; begin - EDocImportParameters."Step to Run" := "Import E-Document Steps"::"Finish draft"; - EDocImportParameters."Purch. Journal V1 Behavior" := EDocImportParameters."Purch. Journal V1 Behavior"::"Create journal line"; - EDocImportParameters."Create Document V1 Behavior" := true; - EDocImport.ProcessIncomingEDocument(Rec, EDocImportParameters); + TempEDocImportParameters."Step to Run" := "Import E-Document Steps"::"Finish draft"; + TempEDocImportParameters."Purch. Journal V1 Behavior" := TempEDocImportParameters."Purch. Journal V1 Behavior"::"Create journal line"; + TempEDocImportParameters."Create Document V1 Behavior" := true; + EDocImport.ProcessIncomingEDocument(Rec, TempEDocImportParameters); if EDocumentErrorHelper.HasErrors(Rec) then Message(DocNotCreatedMsg, Rec."Document Type"); end; diff --git a/src/Apps/W1/EDocument/App/src/Document/Inbound/InboundEDocuments.Page.al b/src/Apps/W1/EDocument/App/src/Document/Inbound/InboundEDocuments.Page.al index c870f71fe0..6f5a4f6539 100644 --- a/src/Apps/W1/EDocument/App/src/Document/Inbound/InboundEDocuments.Page.al +++ b/src/Apps/W1/EDocument/App/src/Document/Inbound/InboundEDocuments.Page.al @@ -265,11 +265,11 @@ page 6105 "Inbound E-Documents" trigger OnAction() var - EDocImportParameters: Record "E-Doc. Import Parameters"; + TempEDocImportParameters: Record "E-Doc. Import Parameters"; EDocImport: Codeunit "E-Doc. Import"; begin - EDocImportParameters."Step to Run" := "Import E-Document Steps"::"Read into Draft"; - EDocImport.ProcessIncomingEDocument(Rec, EDocImportParameters); + TempEDocImportParameters."Step to Run" := "Import E-Document Steps"::"Read into Draft"; + EDocImport.ProcessIncomingEDocument(Rec, TempEDocImportParameters); end; } action(PrepareDraftDocument) @@ -282,13 +282,13 @@ page 6105 "Inbound E-Documents" trigger OnAction() var - EDocImportParameters: Record "E-Doc. Import Parameters"; + TempEDocImportParameters: Record "E-Doc. Import Parameters"; EDocImport: Codeunit "E-Doc. Import"; ImportEDocumentProcess: Codeunit "Import E-Document Process"; begin - EDocImportParameters := Rec.GetEDocumentService().GetDefaultImportParameters(); - EDocImportParameters."Desired E-Document Status" := EDocImportParameters."Desired E-Document Status"::"Draft Ready"; - EDocImport.ProcessIncomingEDocument(Rec, EDocImportParameters); + TempEDocImportParameters := Rec.GetEDocumentService().GetDefaultImportParameters(); + TempEDocImportParameters."Desired E-Document Status" := TempEDocImportParameters."Desired E-Document Status"::"Draft Ready"; + EDocImport.ProcessIncomingEDocument(Rec, TempEDocImportParameters); if ImportEDocumentProcess.IsEDocumentInStateGE(Rec, Enum::"Import E-Doc. Proc. Status"::"Ready for draft") then EDocumentHelper.OpenDraftPage(Rec) end; @@ -303,15 +303,15 @@ page 6105 "Inbound E-Documents" trigger OnAction() var - EDocImportParameters: Record "E-Doc. Import Parameters"; + TempEDocImportParameters: Record "E-Doc. Import Parameters"; EDocImport: Codeunit "E-Doc. Import"; ImportEDocumentProcess: Codeunit "Import E-Document Process"; begin if ImportEDocumentProcess.IsEDocumentInStateGE(Rec, Enum::"Import E-Doc. Proc. Status"::"Ready for draft") then EDocumentHelper.OpenDraftPage(Rec) else begin - EDocImportParameters."Step to Run" := "Import E-Document Steps"::"Prepare draft"; - EDocImport.ProcessIncomingEDocument(Rec, EDocImportParameters); + TempEDocImportParameters."Step to Run" := "Import E-Document Steps"::"Prepare draft"; + EDocImport.ProcessIncomingEDocument(Rec, TempEDocImportParameters); end; end; } diff --git a/src/Apps/W1/EDocument/App/src/Helpers/EDocumentImportHelper.Codeunit.al b/src/Apps/W1/EDocument/App/src/Helpers/EDocumentImportHelper.Codeunit.al index bfe18bcc38..ccd2996294 100644 --- a/src/Apps/W1/EDocument/App/src/Helpers/EDocumentImportHelper.Codeunit.al +++ b/src/Apps/W1/EDocument/App/src/Helpers/EDocumentImportHelper.Codeunit.al @@ -667,10 +667,10 @@ codeunit 6109 "E-Document Import Helper" [Obsolete('Use codeunit 6140 "E-Doc. Import"''s method ProcessIncomingEDocument', '26.0')] procedure ProcessDocument(var EDocument: Record "E-Document"; CreateJnlLine: Boolean) var - EDocImportParameters: Record "E-Doc. Import Parameters"; + TempEDocImportParameters: Record "E-Doc. Import Parameters"; begin - EDocImportParameters."Step to Run" := "Import E-Document Steps"::"Finish draft"; - EDocumentImport.ProcessIncomingEDocument(EDocument, EDocImportParameters); + TempEDocImportParameters."Step to Run" := "Import E-Document Steps"::"Finish draft"; + EDocumentImport.ProcessIncomingEDocument(EDocument, TempEDocImportParameters); end; #endif diff --git a/src/Apps/W1/EDocument/App/src/Processing/AI/Tools/EDocGLAccountMatching.Codeunit.al b/src/Apps/W1/EDocument/App/src/Processing/AI/Tools/EDocGLAccountMatching.Codeunit.al index 7300712173..aee3d82884 100644 --- a/src/Apps/W1/EDocument/App/src/Processing/AI/Tools/EDocGLAccountMatching.Codeunit.al +++ b/src/Apps/W1/EDocument/App/src/Processing/AI/Tools/EDocGLAccountMatching.Codeunit.al @@ -237,13 +237,13 @@ codeunit 6126 "E-Doc. GL Account Matching" implements "AOAI Function", IEDocAISy procedure Execute(Arguments: JsonObject): Variant var - EDocMatchLineBuffer: Record "EDoc Line Match Buffer"; + TempEDocMatchLineBuffer: Record "EDoc Line Match Buffer"; begin - EDocMatchLineBuffer."Line No." := Arguments.GetInteger('lineId'); - EDocMatchLineBuffer."GL Account No." := CopyStr(Arguments.GetText('accountId'), 1, MaxStrLen(EDocMatchLineBuffer."GL Account No.")); - EDocMatchLineBuffer."GL Account Reason" := CopyStr(Arguments.GetText('reasoning'), 1, MaxStrLen(EDocMatchLineBuffer."GL Account Reason")); - EDocMatchLineBuffer."GL Account Candidate Count" := Arguments.GetInteger('totalNumberOfPotentialAccounts'); - exit(EDocMatchLineBuffer); + TempEDocMatchLineBuffer."Line No." := Arguments.GetInteger('lineId'); + TempEDocMatchLineBuffer."GL Account No." := CopyStr(Arguments.GetText('accountId'), 1, MaxStrLen(TempEDocMatchLineBuffer."GL Account No.")); + TempEDocMatchLineBuffer."GL Account Reason" := CopyStr(Arguments.GetText('reasoning'), 1, MaxStrLen(TempEDocMatchLineBuffer."GL Account Reason")); + TempEDocMatchLineBuffer."GL Account Candidate Count" := Arguments.GetInteger('totalNumberOfPotentialAccounts'); + exit(TempEDocMatchLineBuffer); end; procedure GetName(): Text diff --git a/src/Apps/W1/EDocument/App/src/Processing/EDocImport.Codeunit.al b/src/Apps/W1/EDocument/App/src/Processing/EDocImport.Codeunit.al index c5d9bf88eb..eb974e0b5f 100644 --- a/src/Apps/W1/EDocument/App/src/Processing/EDocImport.Codeunit.al +++ b/src/Apps/W1/EDocument/App/src/Processing/EDocImport.Codeunit.al @@ -26,7 +26,7 @@ codeunit 6140 "E-Doc. Import" procedure ReceiveAndProcessAutomatically(EDocumentService: Record "E-Document Service"): Boolean var EDocumentServiceStatus: Record "E-Document Service Status"; - EDocImportParameters: Record "E-Doc. Import Parameters"; + TempEDocImportParameters: Record "E-Doc. Import Parameters"; EDocument: Record "E-Document"; EDocIntegrationMgt: Codeunit "E-Doc. Integration Management"; ReceiveContext: Codeunit ReceiveContext; @@ -40,7 +40,7 @@ codeunit 6140 "E-Doc. Import" #endif EDocIntegrationMgt.ReceiveDocuments(EDocumentService, ReceiveContext); - EDocImportParameters := EDocumentService.GetDefaultImportParameters(); + TempEDocImportParameters := EDocumentService.GetDefaultImportParameters(); AllEDocumentsProcessed := true; EDocumentServiceStatus.SetRange("E-Document Service Code", EDocumentService.Code); @@ -49,7 +49,7 @@ codeunit 6140 "E-Doc. Import" if EDocumentServiceStatus.FindSet() then repeat EDocument.Get(EDocumentServiceStatus."E-Document Entry No"); - AllEDocumentsProcessed := AllEDocumentsProcessed and ProcessIncomingEDocument(EDocument, EDocumentService, EDocImportParameters); + AllEDocumentsProcessed := AllEDocumentsProcessed and ProcessIncomingEDocument(EDocument, EDocumentService, TempEDocImportParameters); until EDocumentServiceStatus.Next() = 0; exit(AllEDocumentsProcessed); end; diff --git a/src/Apps/W1/EDocument/App/src/Processing/EDocumentSubscribers.Codeunit.al b/src/Apps/W1/EDocument/App/src/Processing/EDocumentSubscribers.Codeunit.al index 6fecbb933f..b53bb12b12 100644 --- a/src/Apps/W1/EDocument/App/src/Processing/EDocumentSubscribers.Codeunit.al +++ b/src/Apps/W1/EDocument/App/src/Processing/EDocumentSubscribers.Codeunit.al @@ -438,7 +438,7 @@ codeunit 6103 "E-Document Subscribers" local procedure OnBeforeOnDeletePurchaseHeader(var PurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean) var EDocument: Record "E-Document"; - EDocImportParameters: Record "E-Doc. Import Parameters"; + TempEDocImportParameters: Record "E-Doc. Import Parameters"; EDocImport: Codeunit "E-Doc. Import"; ConfirmDialogMgt: Codeunit "Confirm Management"; begin @@ -450,9 +450,9 @@ codeunit 6103 "E-Document Subscribers" if not ConfirmDialogMgt.GetResponseOrDefault(StrSubstNo(DeleteDocumentQst, EDocument."Entry No")) then Error(''); - EDocImportParameters."Step to Run / Desired Status" := EDocImportParameters."Step to Run / Desired Status"::"Desired E-Document Status"; - EDocImportParameters."Desired E-Document Status" := "Import E-Doc. Proc. Status"::"Draft Ready"; - EDocImport.ProcessIncomingEDocument(EDocument, EDocImportParameters); + TempEDocImportParameters."Step to Run / Desired Status" := TempEDocImportParameters."Step to Run / Desired Status"::"Desired E-Document Status"; + TempEDocImportParameters."Desired E-Document Status" := "Import E-Doc. Proc. Status"::"Draft Ready"; + EDocImport.ProcessIncomingEDocument(EDocument, TempEDocImportParameters); PurchaseHeader.Get(PurchaseHeader."Document Type", PurchaseHeader."No."); end; diff --git a/src/Apps/W1/EDocument/App/src/Processing/Import/ImportEDocumentProcess.Codeunit.al b/src/Apps/W1/EDocument/App/src/Processing/Import/ImportEDocumentProcess.Codeunit.al index 63e70b7b6f..f7ba514c45 100644 --- a/src/Apps/W1/EDocument/App/src/Processing/Import/ImportEDocumentProcess.Codeunit.al +++ b/src/Apps/W1/EDocument/App/src/Processing/Import/ImportEDocumentProcess.Codeunit.al @@ -34,7 +34,7 @@ codeunit 6104 "Import E-Document Process" ImportProcessVersion := GlobalEDocument.GetEDocumentService().GetImportProcessVersion(); if ImportProcessVersion = "E-Document Import Process"::"Version 1.0" then begin - ProcessEDocumentV1(GlobalEDocument, GlobalEDocImportParameters, GlobalStep, GlobalUndoStep); + ProcessEDocumentV1(GlobalEDocument, TempGlobalEDocImportParameters, GlobalStep, GlobalUndoStep); exit; end; @@ -51,9 +51,9 @@ codeunit 6104 "Import E-Document Process" GlobalStep::"Read into Draft": ReadIntoDraft(GlobalEDocument); GlobalStep::"Prepare draft": - PrepareDraft(GlobalEDocument, GlobalEDocImportParameters); + PrepareDraft(GlobalEDocument, TempGlobalEDocImportParameters); GlobalStep::"Finish draft": - FinishDraft(GlobalEDocument, GlobalEDocImportParameters); + FinishDraft(GlobalEDocument, TempGlobalEDocImportParameters); end; GlobalEDocument.Get(GlobalEDocument."Entry No"); @@ -236,7 +236,7 @@ codeunit 6104 "Import E-Document Process" this.GlobalEDocument := EDocument; GlobalStep := NewStep; GlobalUndoStep := NewUndoStep; - this.GlobalEDocImportParameters := EDocImportParameters; + this.TempGlobalEDocImportParameters := EDocImportParameters; end; procedure IsEDocumentInStateGE(EDocument: Record "E-Document"; QueriedState: Enum "Import E-Doc. Proc. Status"): Boolean @@ -360,7 +360,7 @@ codeunit 6104 "Import E-Document Process" var GlobalEDocument: Record "E-Document"; - GlobalEDocImportParameters: Record "E-Doc. Import Parameters"; + TempGlobalEDocImportParameters: Record "E-Doc. Import Parameters"; EDocumentProcessing: Codeunit "E-Document Processing"; GlobalStep: Enum "Import E-Document Steps"; GlobalUndoStep: Boolean; diff --git a/src/Apps/W1/EDocument/App/src/Processing/Import/Purchase/EDocPurchaseDraftSubform.Page.al b/src/Apps/W1/EDocument/App/src/Processing/Import/Purchase/EDocPurchaseDraftSubform.Page.al index 210ad9e8a9..a49e0ab6aa 100644 --- a/src/Apps/W1/EDocument/App/src/Processing/Import/Purchase/EDocPurchaseDraftSubform.Page.al +++ b/src/Apps/W1/EDocument/App/src/Processing/Import/Purchase/EDocPurchaseDraftSubform.Page.al @@ -328,7 +328,7 @@ page 6183 "E-Doc. Purchase Draft Subform" var EDocumentPurchaseHeader: Record "E-Document Purchase Header"; EDocumentPurchaseLine: Record "E-Document Purchase Line"; - EDocumentPOMatchWarnings: Record "E-Doc PO Match Warning"; + TempEDocumentPOMatchWarnings: Record "E-Doc PO Match Warning"; EDocPurchaseHistMapping: Codeunit "E-Doc. Purchase Hist. Mapping"; EDocPOMatching: Codeunit "E-Doc. PO Matching"; AdditionalColumns, OrderMatchedCaption, MatchWarningsCaption, MatchWarningsStyleExpr : Text; @@ -456,8 +456,8 @@ page 6183 "E-Doc. Purchase Draft Subform" local procedure UpdatePOMatching() begin IsEDocumentMatchedToAnyPOLine := EDocPOMatching.IsEDocumentMatchedToAnyPOLine(EDocumentPurchaseHeader); - EDocPOMatching.CalculatePOMatchWarnings(EDocumentPurchaseHeader, EDocumentPOMatchWarnings); - HasEDocumentOrderMatchWarnings := not EDocumentPOMatchWarnings.IsEmpty(); + EDocPOMatching.CalculatePOMatchWarnings(EDocumentPurchaseHeader, TempEDocumentPOMatchWarnings); + HasEDocumentOrderMatchWarnings := not TempEDocumentPOMatchWarnings.IsEmpty(); end; local procedure GetSummaryOfMatchedOrders(): Text @@ -499,13 +499,13 @@ page 6183 "E-Doc. Purchase Draft Subform" MatchWarningsCaption := NoWarningsLbl; MatchWarningsStyleExpr := 'None'; - EDocumentPOMatchWarnings.SetRange("E-Doc. Purchase Line SystemId", Rec.SystemId); + TempEDocumentPOMatchWarnings.SetRange("E-Doc. Purchase Line SystemId", Rec.SystemId); // Severity: Unfavorable (critical) > Ambiguous (warning) > Subordinate (info) SeverityLevel := 0; - if EDocumentPOMatchWarnings.FindSet() then + if TempEDocumentPOMatchWarnings.FindSet() then repeat - case EDocumentPOMatchWarnings."Warning Type" of + case TempEDocumentPOMatchWarnings."Warning Type" of Enum::"E-Doc PO Match Warning"::ExceedsInvoiceableQty: begin CurrentSeverity := 3; @@ -535,9 +535,9 @@ page 6183 "E-Doc. Purchase Draft Subform" SeverityLevel := CurrentSeverity; MatchWarningsStyleExpr := MostSevereStyle; end; - until EDocumentPOMatchWarnings.Next() = 0; + until TempEDocumentPOMatchWarnings.Next() = 0; - if EDocumentPOMatchWarnings.Count() > 1 then + if TempEDocumentPOMatchWarnings.Count() > 1 then MatchWarningsCaption := MultipleWarningsLbl; end; @@ -546,20 +546,20 @@ page 6183 "E-Doc. Purchase Draft Subform" WarningDetails: TextBuilder; MissingInfoDetailLbl: Label 'Quantity information for this line is missing to complete the match. Verify that the draft line has a unit of measure assigned for this item.'; begin - EDocumentPOMatchWarnings.SetRange("E-Doc. Purchase Line SystemId", Rec.SystemId); - if not EDocumentPOMatchWarnings.FindSet() then + TempEDocumentPOMatchWarnings.SetRange("E-Doc. Purchase Line SystemId", Rec.SystemId); + if not TempEDocumentPOMatchWarnings.FindSet() then exit; repeat - case EDocumentPOMatchWarnings."Warning Type" of + case TempEDocumentPOMatchWarnings."Warning Type" of Enum::"E-Doc PO Match Warning"::MissingInformationForMatch: WarningDetails.AppendLine('• ' + MissingInfoDetailLbl); Enum::"E-Doc PO Match Warning"::ExceedsInvoiceableQty, Enum::"E-Doc PO Match Warning"::ExceedsRemainingToInvoice, Enum::"E-Doc PO Match Warning"::OverReceipt: - WarningDetails.AppendLine('• ' + EDocumentPOMatchWarnings."Warning Message"); + WarningDetails.AppendLine('• ' + TempEDocumentPOMatchWarnings."Warning Message"); end; - until EDocumentPOMatchWarnings.Next() = 0; + until TempEDocumentPOMatchWarnings.Next() = 0; if WarningDetails.Length() > 0 then Message(WarningDetails.ToText()); diff --git a/src/Apps/W1/EDocument/App/src/Processing/Import/Purchase/EDocumentPurchaseDraft.Page.al b/src/Apps/W1/EDocument/App/src/Processing/Import/Purchase/EDocumentPurchaseDraft.Page.al index 6b7a9f443e..4b6f7f7f26 100644 --- a/src/Apps/W1/EDocument/App/src/Processing/Import/Purchase/EDocumentPurchaseDraft.Page.al +++ b/src/Apps/W1/EDocument/App/src/Processing/Import/Purchase/EDocumentPurchaseDraft.Page.al @@ -297,7 +297,7 @@ page 6181 "E-Document Purchase Draft" trigger OnAction() var - EDocImportParameters: Record "E-Doc. Import Parameters"; + TempEDocImportParameters: Record "E-Doc. Import Parameters"; begin Session.LogMessage('0000PCO', FinalizeDraftInvokedTxt, Verbosity::Normal, DataClassification::SystemMetadata, TelemetryScope::All, 'Category', EDocumentPurchaseHeader.FeatureName()); Rec.SetAutoCalcFields("Import Processing Status"); @@ -306,7 +306,7 @@ page 6181 "E-Document Purchase Draft" Rec.ShowRecord(); exit; end; - FinalizeEDocument(EDocImportParameters); + FinalizeEDocument(TempEDocImportParameters); end; } action(ResetDraftDocument) @@ -641,7 +641,7 @@ page 6181 "E-Document Purchase Draft" local procedure ResetDraft() var - EDocImportParameters: Record "E-Doc. Import Parameters"; + TempEDocImportParameters: Record "E-Doc. Import Parameters"; EDocImport: Codeunit "E-Doc. Import"; ConfirmDialogMgt: Codeunit "Confirm Management"; Progress: Dialog; @@ -654,10 +654,10 @@ page 6181 "E-Document Purchase Draft" Progress.Open(ProcessingDocumentMsg); // Regardless of document state, we re-run the read data into IR, then prepare draft step. - EDocImportParameters."Step to Run" := Enum::"Import E-Document Steps"::"Read into Draft"; - EDocImport.ProcessIncomingEDocument(Rec, EDocImportParameters); - EDocImportParameters."Step to Run" := Enum::"Import E-Document Steps"::"Prepare draft"; - EDocImport.ProcessIncomingEDocument(Rec, EDocImportParameters); + TempEDocImportParameters."Step to Run" := Enum::"Import E-Document Steps"::"Read into Draft"; + EDocImport.ProcessIncomingEDocument(Rec, TempEDocImportParameters); + TempEDocImportParameters."Step to Run" := Enum::"Import E-Document Steps"::"Prepare draft"; + EDocImport.ProcessIncomingEDocument(Rec, TempEDocImportParameters); Rec.Get(Rec."Entry No"); if GuiAllowed() then @@ -666,7 +666,7 @@ page 6181 "E-Document Purchase Draft" local procedure PrepareDraft() var - EDocImportParameters: Record "E-Doc. Import Parameters"; + TempEDocImportParameters: Record "E-Doc. Import Parameters"; EDocImport: Codeunit "E-Doc. Import"; EDocumentHelper: Codeunit "E-Document Helper"; Progress: Dialog; @@ -676,8 +676,8 @@ page 6181 "E-Document Purchase Draft" if GuiAllowed() then Progress.Open(ProcessingDocumentMsg); - EDocImportParameters."Step to Run" := Enum::"Import E-Document Steps"::"Prepare draft"; - EDocImport.ProcessIncomingEDocument(Rec, EDocImportParameters); + TempEDocImportParameters."Step to Run" := Enum::"Import E-Document Steps"::"Prepare draft"; + EDocImport.ProcessIncomingEDocument(Rec, TempEDocImportParameters); Rec.Get(Rec."Entry No"); if GuiAllowed() then @@ -686,7 +686,7 @@ page 6181 "E-Document Purchase Draft" local procedure AnalyzeEDocument() var - EDocImportParameters: Record "E-Doc. Import Parameters"; + TempEDocImportParameters: Record "E-Doc. Import Parameters"; EDocImport: Codeunit "E-Doc. Import"; Progress: Dialog; begin @@ -696,10 +696,10 @@ page 6181 "E-Document Purchase Draft" Progress.Open(ProcessingDocumentMsg); // Regardless of document state, we re-run the structure received data, then prepare draft step. - EDocImportParameters."Step to Run" := Enum::"Import E-Document Steps"::"Structure received data"; - EDocImport.ProcessIncomingEDocument(Rec, EDocImportParameters); - EDocImportParameters."Step to Run" := Enum::"Import E-Document Steps"::"Prepare draft"; - EDocImport.ProcessIncomingEDocument(Rec, EDocImportParameters); + TempEDocImportParameters."Step to Run" := Enum::"Import E-Document Steps"::"Structure received data"; + EDocImport.ProcessIncomingEDocument(Rec, TempEDocImportParameters); + TempEDocImportParameters."Step to Run" := Enum::"Import E-Document Steps"::"Prepare draft"; + EDocImport.ProcessIncomingEDocument(Rec, TempEDocImportParameters); Rec.Get(Rec."Entry No"); if GuiAllowed() then @@ -729,7 +729,7 @@ page 6181 "E-Document Purchase Draft" local procedure DoLinkToExistingDocument() var PurchaseHeader: Record "Purchase Header"; - EDocImportParameters: Record "E-Doc. Import Parameters"; + TempEDocImportParameters: Record "E-Doc. Import Parameters"; ConfirmDialogMgt: Codeunit "Confirm Management"; LinkToExistingDocumentQst: Label 'Do you want to link this e-document to %1 %2?', Comment = '%1 = Document Type, %2 = Document No.'; RelinkToExistingDocumentQst: Label 'This e-document is already linked to a document. Linking to %1 %2 will unlink the currently linked document. You will need to manually clean up that document. Do you want to continue?', Comment = '%1 = Document Type, %2 = Document No.'; @@ -745,8 +745,8 @@ page 6181 "E-Document Purchase Draft" if not ConfirmDialogMgt.GetResponseOrDefault(ConfirmQst, Rec.Status <> Rec.Status::Processed) then exit; - EDocImportParameters."Existing Doc. RecordId" := PurchaseHeader.RecordId(); - FinalizeEDocument(EDocImportParameters); + TempEDocImportParameters."Existing Doc. RecordId" := PurchaseHeader.RecordId(); + FinalizeEDocument(TempEDocImportParameters); end; var diff --git a/src/Apps/W1/EDocument/Demo Data/3.Transactions/CreateEDocumentTransactions.Codeunit.al b/src/Apps/W1/EDocument/Demo Data/3.Transactions/CreateEDocumentTransactions.Codeunit.al index 8fe4b88f63..20117a3c73 100644 --- a/src/Apps/W1/EDocument/Demo Data/3.Transactions/CreateEDocumentTransactions.Codeunit.al +++ b/src/Apps/W1/EDocument/Demo Data/3.Transactions/CreateEDocumentTransactions.Codeunit.al @@ -430,7 +430,7 @@ codeunit 5376 "Create E-Document Transactions" local procedure CreateEDocument(Filetxt: Text) var EDocument: Record "E-Document"; - EDocImportParameters: Record "E-Doc. Import Parameters"; + TempEDocImportParameters: Record "E-Doc. Import Parameters"; TempBlob: Codeunit "Temp Blob"; EDocImport: Codeunit "E-Doc. Import"; EDocImportHelper: Codeunit "E-Document Import Helper"; @@ -440,8 +440,8 @@ codeunit 5376 "Create E-Document Transactions" TempBlob.CreateOutStream(XMLOutStream); XMLOutStream.WriteText(StrSubstNo(Filetxt)); EDocument := CreateEDoc(TempBlob); - EDocImportParameters."Step to Run" := "Import E-Document Steps"::"Finish draft"; - EDocImport.ProcessIncomingEDocument(EDocument, EDocImportParameters); + TempEDocImportParameters."Step to Run" := "Import E-Document Steps"::"Finish draft"; + EDocImport.ProcessIncomingEDocument(EDocument, TempEDocImportParameters); end; local procedure CreateEDoc(var TempBlob: Codeunit "Temp Blob"): Record "E-Document"; diff --git a/src/Apps/W1/EDocument/Demo Data/EDocFromResourcesImpl/EDocFromResourceHelper.Codeunit.al b/src/Apps/W1/EDocument/Demo Data/EDocFromResourcesImpl/EDocFromResourceHelper.Codeunit.al index 14b8121898..5e8962abff 100644 --- a/src/Apps/W1/EDocument/Demo Data/EDocFromResourcesImpl/EDocFromResourceHelper.Codeunit.al +++ b/src/Apps/W1/EDocument/Demo Data/EDocFromResourcesImpl/EDocFromResourceHelper.Codeunit.al @@ -64,7 +64,7 @@ codeunit 5405 "E-Doc. From Resource Helper" local procedure ImportDocument(EDocumentService: Record "E-Document Service"; DocumentPath: Text) EDocument: Record "E-Document"; var - EDocImportParameters: Record "E-Doc. Import Parameters"; + TempEDocImportParameters: Record "E-Doc. Import Parameters"; EDocImport: Codeunit "E-Doc. Import"; ResInStream: InStream; FileName: Text; @@ -80,9 +80,9 @@ codeunit 5405 "E-Doc. From Resource Helper" Enum::"E-Doc. File Format"::PDF, FileName, ResInStream); EDocument."Structure Data Impl." := Enum::"Structure Received E-Doc."::"ADI Mock"; EDocument.Modify(); - EDocImportParameters."Step to Run" := "Import E-Document Steps"::"Read into Draft"; + TempEDocImportParameters."Step to Run" := "Import E-Document Steps"::"Read into Draft"; EDocImport.ProcessIncomingEDocument( - EDocument, EDocumentService, EDocImportParameters); + EDocument, EDocumentService, TempEDocImportParameters); end; local procedure MapPurchaseDocumentDraftLines(EDocument: Record "E-Document") @@ -147,12 +147,12 @@ codeunit 5405 "E-Doc. From Resource Helper" local procedure FinalizeDraft(EDocumentService: Record "E-Document Service"; EDocument: Record "E-Document") var - EDocImportParameters: Record "E-Doc. Import Parameters"; + TempEDocImportParameters: Record "E-Doc. Import Parameters"; EDocImport: Codeunit "E-Doc. Import"; begin - EDocImportParameters."Step to Run" := "Import E-Document Steps"::"Finish draft"; + TempEDocImportParameters."Step to Run" := "Import E-Document Steps"::"Finish draft"; EDocImport.ProcessIncomingEDocument( - EDocument, EDocumentService, EDocImportParameters); + EDocument, EDocumentService, TempEDocImportParameters); end; local procedure PostPurchInvoice(EDocument: Record "E-Document") PurchInvHeader: Record "Purch. Inv. Header"; diff --git a/src/Apps/W1/EDocument/Demo Data/EDocumentInvoices/ContosoInboundEDocument.Codeunit.al b/src/Apps/W1/EDocument/Demo Data/EDocumentInvoices/ContosoInboundEDocument.Codeunit.al index 81be39801f..cdd150b5e7 100644 --- a/src/Apps/W1/EDocument/Demo Data/EDocumentInvoices/ContosoInboundEDocument.Codeunit.al +++ b/src/Apps/W1/EDocument/Demo Data/EDocumentInvoices/ContosoInboundEDocument.Codeunit.al @@ -128,11 +128,11 @@ codeunit 5429 "Contoso Inbound E-Document" local procedure ProcessEDocument(EDocument: Record "E-Document") var - EDocImportParameters: Record "E-Doc. Import Parameters"; + TempEDocImportParameters: Record "E-Doc. Import Parameters"; EDocImport: Codeunit "E-Doc. Import"; begin - EDocImportParameters."Step to Run" := "Import E-Document Steps"::"Finish draft"; - EDocImport.ProcessIncomingEDocument(EDocument, EDocImportParameters); + TempEDocImportParameters."Step to Run" := "Import E-Document Steps"::"Finish draft"; + EDocImport.ProcessIncomingEDocument(EDocument, TempEDocImportParameters); end; local procedure PostPurchaseInvoice(EDocEntryNo: Integer) diff --git a/src/Apps/W1/EDocument/Test/src/Processing/EDocE2ETest.Codeunit.al b/src/Apps/W1/EDocument/Test/src/Processing/EDocE2ETest.Codeunit.al index 50d05d79ea..e98eebd299 100644 --- a/src/Apps/W1/EDocument/Test/src/Processing/EDocE2ETest.Codeunit.al +++ b/src/Apps/W1/EDocument/Test/src/Processing/EDocE2ETest.Codeunit.al @@ -1725,7 +1725,7 @@ codeunit 139624 "E-Doc E2E Test" var EDocument: Record "E-Document"; PurchaseHeader: Record "Purchase Header"; - EDocImportParams: Record "E-Doc. Import Parameters"; + TempEDocImportParams: Record "E-Doc. Import Parameters"; begin // [FEATURE] [E-Document] [Processing] // [SCENARIO] @@ -1735,8 +1735,8 @@ codeunit 139624 "E-Doc E2E Test" EDocumentService.Modify(); // [GIVEN] An inbound e-document is received and fully processed - EDocImportParams."Step to Run" := "Import E-Document Steps"::"Finish draft"; - Assert.IsTrue(LibraryEDoc.CreateInboundPEPPOLDocumentToState(EDocument, EDocumentService, 'peppol/peppol-invoice-0.xml', EDocImportParams), 'The e-document should be processed'); + TempEDocImportParams."Step to Run" := "Import E-Document Steps"::"Finish draft"; + Assert.IsTrue(LibraryEDoc.CreateInboundPEPPOLDocumentToState(EDocument, EDocumentService, 'peppol/peppol-invoice-0.xml', TempEDocImportParams), 'The e-document should be processed'); EDocument.SetRecFilter(); EDocument.FindLast(); Assert.AreEqual(Enum::"E-Document Status"::Processed, EDocument.Status, 'E-Document should be in Processed status.'); @@ -1756,18 +1756,18 @@ codeunit 139624 "E-Doc E2E Test" EDocument: Record "E-Document"; PurchaseHeader: Record "Purchase Header"; PurchaseLine: Record "Purchase Line"; - EDocImportParams: Record "E-Doc. Import Parameters"; + TempEDocImportParams: Record "E-Doc. Import Parameters"; begin // [SCENARIO] Import a PEPPOL invoice with AdditionalDocumentReference elements // that have no child (text-only references). // Previously this caused "Please choose a file to attach" error. Initialize(Enum::"Service Integration"::"Mock"); - EDocImportParams."Step to Run" := "Import E-Document Steps"::"Finish draft"; + TempEDocImportParams."Step to Run" := "Import E-Document Steps"::"Finish draft"; WorkDate(DMY2Date(1, 1, 2027)); Assert.IsTrue( LibraryEDoc.CreateInboundPEPPOLDocumentToState( - EDocument, EDocumentService, 'peppol/peppol-invoice-textonly-docref.xml', EDocImportParams), + EDocument, EDocumentService, 'peppol/peppol-invoice-textonly-docref.xml', TempEDocImportParams), 'The e-document should be processed'); EDocument.Get(EDocument."Entry No"); @@ -1783,17 +1783,17 @@ codeunit 139624 "E-Doc E2E Test" EDocument: Record "E-Document"; PurchaseHeader: Record "Purchase Header"; PurchaseLine: Record "Purchase Line"; - EDocImportParams: Record "E-Doc. Import Parameters"; + TempEDocImportParams: Record "E-Doc. Import Parameters"; begin // [SCENARIO] Import a PEPPOL invoice with non-integer line IDs (e.g., "1.1", "1.2"). // Previously this caused "The value '1.1' can't be evaluated into type Integer" error. Initialize(Enum::"Service Integration"::"Mock"); - EDocImportParams."Step to Run" := "Import E-Document Steps"::"Finish draft"; + TempEDocImportParams."Step to Run" := "Import E-Document Steps"::"Finish draft"; WorkDate(DMY2Date(1, 1, 2027)); Assert.IsTrue( LibraryEDoc.CreateInboundPEPPOLDocumentToState( - EDocument, EDocumentService, 'peppol/peppol-invoice-hierarchical-lineids.xml', EDocImportParams), + EDocument, EDocumentService, 'peppol/peppol-invoice-hierarchical-lineids.xml', TempEDocImportParams), 'The e-document should be processed'); EDocument.Get(EDocument."Entry No"); @@ -1917,7 +1917,7 @@ codeunit 139624 "E-Doc E2E Test" internal procedure PurchaseDocumentsCreatedFromEDocumentsUseDocumentTotalsValidation() var EDocument: Record "E-Document"; - EDocImportParameters: Record "E-Doc. Import Parameters"; + TempEDocImportParameters: Record "E-Doc. Import Parameters"; PurchaseHeader: Record "Purchase Header"; PurchasesPayablesSetup: Record "Purchases & Payables Setup"; EDocImport: Codeunit "E-Doc. Import"; @@ -1933,8 +1933,8 @@ codeunit 139624 "E-Doc E2E Test" LibraryEDoc.CreateInboundEDocument(EDocument, EDocumentService); LibraryEDoc.MockPurchaseDraftPrepared(EDocument); // [WHEN] Processing into a purchase invoice - EDocImportParameters."Step to Run" := "Import E-Document Steps"::"Finish draft"; - EDocImport.ProcessIncomingEDocument(EDocument, EDocImportParameters); + TempEDocImportParameters."Step to Run" := "Import E-Document Steps"::"Finish draft"; + EDocImport.ProcessIncomingEDocument(EDocument, TempEDocImportParameters); // [THEN] The purchase invoice should have the totals from the E-Document PurchaseHeader.SetRange("E-Document Link", EDocument.SystemId); PurchaseHeader.FindFirst(); @@ -1948,7 +1948,7 @@ codeunit 139624 "E-Doc E2E Test" internal procedure PurchaseDocumentsCreatedFromStructuredEDocumentCantEditTotals() var EDocument: Record "E-Document"; - EDocImportParameters: Record "E-Doc. Import Parameters"; + TempEDocImportParameters: Record "E-Doc. Import Parameters"; PurchaseHeader: Record "Purchase Header"; EDocImport: Codeunit "E-Doc. Import"; PurchaseInvoice: TestPage "Purchase Invoice"; @@ -1960,8 +1960,8 @@ codeunit 139624 "E-Doc E2E Test" LibraryEDoc.CreateInboundEDocument(EDocument, EDocumentService); LibraryEDoc.MockPurchaseDraftPrepared(EDocument); // [WHEN] Processing into a purchase invoice - EDocImportParameters."Step to Run" := "Import E-Document Steps"::"Finish draft"; - EDocImport.ProcessIncomingEDocument(EDocument, EDocImportParameters); + TempEDocImportParameters."Step to Run" := "Import E-Document Steps"::"Finish draft"; + EDocImport.ProcessIncomingEDocument(EDocument, TempEDocImportParameters); PurchaseHeader.SetRange("E-Document Link", EDocument.SystemId); PurchaseHeader.FindFirst(); // [THEN] The purchase invoice page should not allow editing of the totals @@ -2943,7 +2943,7 @@ codeunit 139624 "E-Doc E2E Test" var EDocument: Record "E-Document"; PurchaseHeader: Record "Purchase Header"; - EDocImportParams: Record "E-Doc. Import Parameters"; + TempEDocImportParams: Record "E-Doc. Import Parameters"; begin // [FEATURE] [E-Document] [Processing] // [SCENARIO] @@ -2953,8 +2953,8 @@ codeunit 139624 "E-Doc E2E Test" EDocumentService.Modify(); // [GIVEN] An inbound e-document is received and fully processed - EDocImportParams."Step to Run" := "Import E-Document Steps"::"Finish draft"; - Assert.IsTrue(LibraryEDoc.CreateInboundPEPPOLDocumentToState(EDocument, EDocumentService, 'peppol/peppol-invoice-0.xml', EDocImportParams), 'The e-document should be processed'); + TempEDocImportParams."Step to Run" := "Import E-Document Steps"::"Finish draft"; + Assert.IsTrue(LibraryEDoc.CreateInboundPEPPOLDocumentToState(EDocument, EDocumentService, 'peppol/peppol-invoice-0.xml', TempEDocImportParams), 'The e-document should be processed'); EDocument.SetRecFilter(); EDocument.FindLast(); Assert.AreEqual(Enum::"E-Document Status"::Processed, EDocument.Status, 'E-Document should be in Processed status.'); diff --git a/src/Apps/W1/EDocument/Test/src/Processing/EDocEmailTests.Codeunit.al b/src/Apps/W1/EDocument/Test/src/Processing/EDocEmailTests.Codeunit.al index 1d3ba45a3d..545e6c4d7f 100644 --- a/src/Apps/W1/EDocument/Test/src/Processing/EDocEmailTests.Codeunit.al +++ b/src/Apps/W1/EDocument/Test/src/Processing/EDocEmailTests.Codeunit.al @@ -26,7 +26,7 @@ codeunit 139746 "E-Doc. Email Tests" Access = Internal; var - Account: Record "Email Account"; + TempAccount: Record "Email Account"; Customer: Record Customer; Vendor: Record Vendor; EDocument: Record "E-Document"; @@ -76,8 +76,8 @@ codeunit 139746 "E-Doc. Email Tests" DocumentSendingProfile.Modify(); EmailConnectorMock.Initialize(); - EmailConnectorMock.AddAccount(Account); - EmailScenario.SetDefaultEmailAccount(Account); + EmailConnectorMock.AddAccount(TempAccount); + EmailScenario.SetDefaultEmailAccount(TempAccount); Customer."E-Mail" := 'Test123@example.com'; Customer.Modify(); @@ -150,8 +150,8 @@ codeunit 139746 "E-Doc. Email Tests" DocumentSendingProfile.Modify(); EmailConnectorMock.Initialize(); - EmailConnectorMock.AddAccount(Account); - EmailScenario.SetDefaultEmailAccount(Account); + EmailConnectorMock.AddAccount(TempAccount); + EmailScenario.SetDefaultEmailAccount(TempAccount); Customer."E-Mail" := 'Test123@example.com'; Customer.Modify(); diff --git a/src/Apps/W1/EDocument/Test/src/Processing/EDocLinkToExistingTest.Codeunit.al b/src/Apps/W1/EDocument/Test/src/Processing/EDocLinkToExistingTest.Codeunit.al index 700fa146e3..a09a4ab419 100644 --- a/src/Apps/W1/EDocument/Test/src/Processing/EDocLinkToExistingTest.Codeunit.al +++ b/src/Apps/W1/EDocument/Test/src/Processing/EDocLinkToExistingTest.Codeunit.al @@ -417,7 +417,7 @@ codeunit 139886 "E-Doc Link To Existing Test" CreatedPurchaseHeader: Record "Purchase Header"; ExistingPurchaseHeader: Record "Purchase Header"; ICPartner: Record "IC Partner"; - EDocImportParameters: Record "E-Doc. Import Parameters"; + TempEDocImportParameters: Record "E-Doc. Import Parameters"; EDocImport: Codeunit "E-Doc. Import"; EDocPurchaseDraftTestPage: TestPage "E-Document Purchase Draft"; CreatedDocNo: Code[20]; @@ -438,8 +438,8 @@ codeunit 139886 "E-Doc Link To Existing Test" EDocumentPurchaseHeader.Modify(); // [GIVEN] Finalize draft to create a new PI from e-document - EDocImportParameters."Step to Run" := Enum::"Import E-Document Steps"::"Finish draft"; - EDocImport.ProcessIncomingEDocument(EDocument, EDocImportParameters); + TempEDocImportParameters."Step to Run" := Enum::"Import E-Document Steps"::"Finish draft"; + EDocImport.ProcessIncomingEDocument(EDocument, TempEDocImportParameters); EDocument.Get(EDocument."Entry No"); // [GIVEN] Find the created purchase invoice @@ -594,4 +594,4 @@ codeunit 139886 "E-Doc Link To Existing Test" LibraryPurchase: Codeunit "Library - Purchase"; LibraryERM: Codeunit "Library - ERM"; LibraryVariableStorage: Codeunit "Library - Variable Storage"; -} \ No newline at end of file +} diff --git a/src/Apps/W1/EDocument/Test/src/Processing/EDocProcessTest.Codeunit.al b/src/Apps/W1/EDocument/Test/src/Processing/EDocProcessTest.Codeunit.al index c6700ea65f..c5b2113089 100644 --- a/src/Apps/W1/EDocument/Test/src/Processing/EDocProcessTest.Codeunit.al +++ b/src/Apps/W1/EDocument/Test/src/Processing/EDocProcessTest.Codeunit.al @@ -48,7 +48,7 @@ codeunit 139883 "E-Doc Process Test" procedure ProcessStructureReceivedData() var EDocument: Record "E-Document"; - EDocImportParameters: Record "E-Doc. Import Parameters"; + TempEDocImportParameters: Record "E-Doc. Import Parameters"; EDocDataStorage: Record "E-Doc. Data Storage"; EDocLogRecord: Record "E-Document Log"; EDocImport: Codeunit "E-Doc. Import"; @@ -70,11 +70,11 @@ codeunit 139883 "E-Doc Process Test" EDocument.Modify(); EDocumentProcessing.ModifyEDocumentProcessingStatus(EDocument, "Import E-Doc. Proc. Status"::Unprocessed); - EDocImportParameters."Step to Run" := "Import E-Document Steps"::"Structure received data"; + TempEDocImportParameters."Step to Run" := "Import E-Document Steps"::"Structure received data"; EDocument.CalcFields("Import Processing Status"); Assert.AreEqual(Enum::"Import E-Doc. Proc. Status"::Unprocessed, EDocument."Import Processing Status", 'The status should be updated to the one after the step executed.'); - EDocImport.ProcessIncomingEDocument(EDocument, EDocImportParameters); + EDocImport.ProcessIncomingEDocument(EDocument, TempEDocImportParameters); EDocument.CalcFields("Import Processing Status"); Assert.AreEqual(Enum::"Import E-Doc. Proc. Status"::Readable, EDocument."Import Processing Status", 'The status should be updated to the one after the step executed.'); EDocument.Get(EDocument."Entry No"); @@ -90,7 +90,7 @@ codeunit 139883 "E-Doc Process Test" procedure ProcessingDoesSequenceOfSteps() var EDocument: Record "E-Document"; - EDocImportParameters: Record "E-Doc. Import Parameters"; + TempEDocImportParameters: Record "E-Doc. Import Parameters"; EDocLogRecord: Record "E-Document Log"; EDocImport: Codeunit "E-Doc. Import"; EDocumentProcessing: Codeunit "E-Document Processing"; @@ -111,18 +111,18 @@ codeunit 139883 "E-Doc Process Test" EDocument.Modify(); EDocumentProcessing.ModifyEDocumentProcessingStatus(EDocument, "Import E-Doc. Proc. Status"::Unprocessed); - EDocImportParameters."Step to Run" := "Import E-Document Steps"::"Prepare draft"; - EDocImport.ProcessIncomingEDocument(EDocument, EDocImportParameters); + TempEDocImportParameters."Step to Run" := "Import E-Document Steps"::"Prepare draft"; + EDocImport.ProcessIncomingEDocument(EDocument, TempEDocImportParameters); EDocument.CalcFields("Import Processing Status"); - Assert.AreEqual(ImportEDocumentProcess.GetStatusForStep(EDocImportParameters."Step to Run", false), EDocument."Import Processing Status", 'The status should be updated to the one after the step executed.'); + Assert.AreEqual(ImportEDocumentProcess.GetStatusForStep(TempEDocImportParameters."Step to Run", false), EDocument."Import Processing Status", 'The status should be updated to the one after the step executed.'); end; [Test] procedure ProcessingUndoesSteps() var EDocument: Record "E-Document"; - EDocImportParameters: Record "E-Doc. Import Parameters"; + TempEDocImportParameters: Record "E-Doc. Import Parameters"; EDocLogRecord: Record "E-Document Log"; EDocImport: Codeunit "E-Doc. Import"; EDocumentProcessing: Codeunit "E-Document Processing"; @@ -143,17 +143,17 @@ codeunit 139883 "E-Doc Process Test" EDocument.Modify(); EDocumentProcessing.ModifyEDocumentProcessingStatus(EDocument, "Import E-Doc. Proc. Status"::Unprocessed); - EDocImportParameters."Step to Run" := "Import E-Document Steps"::"Prepare draft"; - EDocImport.ProcessIncomingEDocument(EDocument, EDocImportParameters); + TempEDocImportParameters."Step to Run" := "Import E-Document Steps"::"Prepare draft"; + EDocImport.ProcessIncomingEDocument(EDocument, TempEDocImportParameters); EDocument.CalcFields("Import Processing Status"); - Assert.AreEqual(ImportEDocumentProcess.GetStatusForStep(EDocImportParameters."Step to Run", false), EDocument."Import Processing Status", 'The status should be updated to the one after the step executed.'); + Assert.AreEqual(ImportEDocumentProcess.GetStatusForStep(TempEDocImportParameters."Step to Run", false), EDocument."Import Processing Status", 'The status should be updated to the one after the step executed.'); - EDocImportParameters."Step to Run" := "Import E-Document Steps"::"Structure received data"; - EDocImport.ProcessIncomingEDocument(EDocument, EDocImportParameters); + TempEDocImportParameters."Step to Run" := "Import E-Document Steps"::"Structure received data"; + EDocImport.ProcessIncomingEDocument(EDocument, TempEDocImportParameters); EDocument.CalcFields("Import Processing Status"); - Assert.AreEqual(ImportEDocumentProcess.GetStatusForStep(EDocImportParameters."Step to Run", false), EDocument."Import Processing Status", 'The status should be updated to the one after the step executed.'); + Assert.AreEqual(ImportEDocumentProcess.GetStatusForStep(TempEDocImportParameters."Step to Run", false), EDocument."Import Processing Status", 'The status should be updated to the one after the step executed.'); end; [Test] @@ -161,7 +161,7 @@ codeunit 139883 "E-Doc Process Test" var EDocument: Record "E-Document"; EDocumentPurchaseHeader: Record "E-Document Purchase Header"; - EDocImportParameters: Record "E-Doc. Import Parameters"; + TempEDocImportParameters: Record "E-Doc. Import Parameters"; EDocLogRecord: Record "E-Document Log"; PurchaseHeader: Record "Purchase Header"; EDocumentLog: Codeunit "E-Document Log"; @@ -187,8 +187,8 @@ codeunit 139883 "E-Doc Process Test" EDocument.Modify(); EDocumentProcessing.ModifyEDocumentProcessingStatus(EDocument, "Import E-Doc. Proc. Status"::"Ready for draft"); - EDocImportParameters."Step to Run" := "Import E-Document Steps"::"Prepare draft"; - EDocImport.ProcessIncomingEDocument(EDocument, EDocImportParameters); + TempEDocImportParameters."Step to Run" := "Import E-Document Steps"::"Prepare draft"; + EDocImport.ProcessIncomingEDocument(EDocument, TempEDocImportParameters); EDocumentPurchaseHeader.SetRecFilter(); EDocumentPurchaseHeader.FindFirst(); @@ -204,7 +204,7 @@ codeunit 139883 "E-Doc Process Test" var EDocument: Record "E-Document"; EDocumentPurchaseHeader: Record "E-Document Purchase Header"; - EDocImportParameters: Record "E-Doc. Import Parameters"; + TempEDocImportParameters: Record "E-Doc. Import Parameters"; Vendor2: Record Vendor; CompanyInformation: Record "Company Information"; EDocumentProcessing: Codeunit "E-Document Processing"; @@ -223,8 +223,8 @@ codeunit 139883 "E-Doc Process Test" EDocumentPurchaseHeader.Insert(); EDocumentProcessing.ModifyEDocumentProcessingStatus(EDocument, "Import E-Doc. Proc. Status"::"Ready for draft"); - EDocImportParameters."Step to Run" := "Import E-Document Steps"::"Prepare draft"; - EDocImport.ProcessIncomingEDocument(EDocument, EDocImportParameters); + TempEDocImportParameters."Step to Run" := "Import E-Document Steps"::"Prepare draft"; + EDocImport.ProcessIncomingEDocument(EDocument, TempEDocImportParameters); EDocumentPurchaseHeader.SetRecFilter(); EDocumentPurchaseHeader.FindFirst(); @@ -240,7 +240,7 @@ codeunit 139883 "E-Doc Process Test" EDocument: Record "E-Document"; EDocumentPurchaseHeader: Record "E-Document Purchase Header"; EDocumentPurchaseLine: Record "E-Document Purchase Line"; - EDocImportParameters: Record "E-Doc. Import Parameters"; + TempEDocImportParameters: Record "E-Doc. Import Parameters"; Vendor2: Record Vendor; CompanyInformation: Record "Company Information"; GLAccount: Record "G/L Account"; @@ -272,8 +272,8 @@ codeunit 139883 "E-Doc Process Test" EDocumentPurchaseLine.Insert(); EDocumentProcessing.ModifyEDocumentProcessingStatus(EDocument, "Import E-Doc. Proc. Status"::"Ready for draft"); - EDocImportParameters."Step to Run" := "Import E-Document Steps"::"Prepare draft"; - EDocImport.ProcessIncomingEDocument(EDocument, EDocImportParameters); + TempEDocImportParameters."Step to Run" := "Import E-Document Steps"::"Prepare draft"; + EDocImport.ProcessIncomingEDocument(EDocument, TempEDocImportParameters); EDocumentPurchaseLine.SetRecFilter(); EDocumentPurchaseLine.FindFirst(); @@ -296,7 +296,7 @@ codeunit 139883 "E-Doc Process Test" procedure FinishDraftCanBeUndone() var EDocument: Record "E-Document"; - EDocImportParameters: Record "E-Doc. Import Parameters"; + TempEDocImportParameters: Record "E-Doc. Import Parameters"; PurchaseHeader: Record "Purchase Header"; EDocLogRecord: Record "E-Document Log"; EDocImport: Codeunit "E-Doc. Import"; @@ -319,15 +319,15 @@ codeunit 139883 "E-Doc Process Test" EDocumentProcessing.ModifyEDocumentProcessingStatus(EDocument, "Import E-Doc. Proc. Status"::"Draft Ready"); - EDocImportParameters."Step to Run" := "Import E-Document Steps"::"Finish draft"; - EDocImportParameters."Processing Customizations" := "E-Doc. Proc. Customizations"::"Mock Create Purchase Invoice"; - EDocImport.ProcessIncomingEDocument(EDocument, EDocImportParameters); + TempEDocImportParameters."Step to Run" := "Import E-Document Steps"::"Finish draft"; + TempEDocImportParameters."Processing Customizations" := "E-Doc. Proc. Customizations"::"Mock Create Purchase Invoice"; + EDocImport.ProcessIncomingEDocument(EDocument, TempEDocImportParameters); PurchaseHeader.SetRange("E-Document Link", EDocument.SystemId); PurchaseHeader.FindFirst(); - EDocImportParameters."Step to Run" := "Import E-Document Steps"::"Structure received data"; - EDocImport.ProcessIncomingEDocument(EDocument, EDocImportParameters); + TempEDocImportParameters."Step to Run" := "Import E-Document Steps"::"Structure received data"; + EDocImport.ProcessIncomingEDocument(EDocument, TempEDocImportParameters); Assert.RecordIsEmpty(PurchaseHeader); end; @@ -336,7 +336,7 @@ codeunit 139883 "E-Doc Process Test" procedure FinishDraftFromReadyForDraftStateSucceeds() var EDocument: Record "E-Document"; - EDocImportParameters: Record "E-Doc. Import Parameters"; + TempEDocImportParameters: Record "E-Doc. Import Parameters"; PurchaseHeader: Record "Purchase Header"; EDocLogRecord: Record "E-Document Log"; EDocumentPurchaseHeader: Record "E-Document Purchase Header"; @@ -374,9 +374,9 @@ codeunit 139883 "E-Doc Process Test" Assert.AreEqual(Enum::"Import E-Doc. Proc. Status"::"Ready for draft", EDocument."Import Processing Status", 'The status should be Ready for draft before processing.'); // [WHEN] Finish draft step is executed (simulating finalize action) - EDocImportParameters."Step to Run" := "Import E-Document Steps"::"Finish draft"; - EDocImportParameters."Processing Customizations" := "E-Doc. Proc. Customizations"::"Mock Create Purchase Invoice"; - EDocImport.ProcessIncomingEDocument(EDocument, EDocImportParameters); + TempEDocImportParameters."Step to Run" := "Import E-Document Steps"::"Finish draft"; + TempEDocImportParameters."Processing Customizations" := "E-Doc. Proc. Customizations"::"Mock Create Purchase Invoice"; + EDocImport.ProcessIncomingEDocument(EDocument, TempEDocImportParameters); // [THEN] The document is processed (the system ran Prepare draft automatically and then Finish draft) EDocument.CalcFields("Import Processing Status"); @@ -392,7 +392,7 @@ codeunit 139883 "E-Doc Process Test" procedure ProcessingInboundDocumentCreatesLinks() var EDocument: Record "E-Document"; - EDocImportParams: Record "E-Doc. Import Parameters"; + TempEDocImportParams: Record "E-Doc. Import Parameters"; PurchaseHeader: Record "Purchase Header"; PurchaseLine: Record "Purchase Line"; EDocRecordLink: Record "E-Doc. Record Link"; @@ -405,9 +405,9 @@ codeunit 139883 "E-Doc Process Test" EDocRecordLink.DeleteAll(); // [GIVEN] An inbound e-document is received and fully processed - EDocImportParams."Step to Run" := "Import E-Document Steps"::"Finish draft"; + TempEDocImportParams."Step to Run" := "Import E-Document Steps"::"Finish draft"; WorkDate(DMY2Date(1, 1, 2027)); // Peppol document date is in 2026 - Assert.IsTrue(LibraryEDoc.CreateInboundPEPPOLDocumentToState(EDocument, EDocumentService, 'peppol/peppol-invoice-0.xml', EDocImportParams), 'The e-document should be processed'); + Assert.IsTrue(LibraryEDoc.CreateInboundPEPPOLDocumentToState(EDocument, EDocumentService, 'peppol/peppol-invoice-0.xml', TempEDocImportParams), 'The e-document should be processed'); EDocument.Get(EDocument."Entry No"); PurchaseHeader.Get(EDocument."Document Record ID"); @@ -431,7 +431,7 @@ codeunit 139883 "E-Doc Process Test" procedure PostingInboundDocumentCreatesHistoricalRecords() var EDocument: Record "E-Document"; - EDocImportParams: Record "E-Doc. Import Parameters"; + TempEDocImportParams: Record "E-Doc. Import Parameters"; PurchaseHeader: Record "Purchase Header"; PurchaseInvoiceHeader: Record "Purch. Inv. Header"; EDocVendorAssignmentHistory: Record "E-Doc. Vendor Assign. History"; @@ -445,9 +445,9 @@ codeunit 139883 "E-Doc Process Test" EDocumentService.Modify(); // [GIVEN] An inbound e-document is received and fully processed - EDocImportParams."Step to Run" := "Import E-Document Steps"::"Finish draft"; + TempEDocImportParams."Step to Run" := "Import E-Document Steps"::"Finish draft"; WorkDate(DMY2Date(1, 1, 2027)); // Peppol document date is in 2026 - Assert.IsTrue(LibraryEDoc.CreateInboundPEPPOLDocumentToState(EDocument, EDocumentService, 'peppol/peppol-invoice-0.xml', EDocImportParams), 'The e-document should be processed'); + Assert.IsTrue(LibraryEDoc.CreateInboundPEPPOLDocumentToState(EDocument, EDocumentService, 'peppol/peppol-invoice-0.xml', TempEDocImportParams), 'The e-document should be processed'); EDocument.Get(EDocument."Entry No"); PurchaseHeader.Get(EDocument."Document Record ID"); @@ -481,7 +481,7 @@ codeunit 139883 "E-Doc Process Test" PurchaseLine: Record "Purchase Line"; PurchaseInvoiceLine: Record "Purch. Inv. Line"; EDocument: Record "E-Document"; - EDocImportParams: Record "E-Doc. Import Parameters"; + TempEDocImportParams: Record "E-Doc. Import Parameters"; PurchaseHeader: Record "Purchase Header"; EDocPurchLineField: Record "E-Document Line - Field"; EDocPurchaseLine: Record "E-Document Purchase Line"; @@ -498,9 +498,9 @@ codeunit 139883 "E-Doc Process Test" EDocPurchLineFieldSetup."Field No." := PurchaseInvoiceLine.FieldNo("IC Partner Code"); EDocPurchLineFieldSetup.Insert(); // [GIVEN] An inbound e-document is received and a draft created - EDocImportParams."Step to Run" := "Import E-Document Steps"::"Prepare draft"; + TempEDocImportParams."Step to Run" := "Import E-Document Steps"::"Prepare draft"; WorkDate(DMY2Date(1, 1, 2027)); // Peppol document date is in 2026 - Assert.IsTrue(LibraryEDoc.CreateInboundPEPPOLDocumentToState(EDocument, EDocumentService, 'peppol/peppol-invoice-0.xml', EDocImportParams), 'The draft for the e-document should be created'); + Assert.IsTrue(LibraryEDoc.CreateInboundPEPPOLDocumentToState(EDocument, EDocumentService, 'peppol/peppol-invoice-0.xml', TempEDocImportParams), 'The draft for the e-document should be created'); // [WHEN] Storing custom values for the additional fields of the first line EDocPurchLineField."E-Document Entry No." := EDocument."Entry No"; @@ -514,8 +514,8 @@ codeunit 139883 "E-Doc Process Test" EDocPurchLineField.Insert(); // [WHEN] Creating a purchase invoice from the draft - EDocImportParams."Step to Run" := "Import E-Document Steps"::"Finish draft"; - Assert.IsTrue(EDocImport.ProcessIncomingEDocument(EDocument, EDocImportParams), 'The e-document should be processed'); + TempEDocImportParams."Step to Run" := "Import E-Document Steps"::"Finish draft"; + Assert.IsTrue(EDocImport.ProcessIncomingEDocument(EDocument, TempEDocImportParams), 'The e-document should be processed'); // [THEN] The additional fields should be set on the purchase invoice line EDocument.Get(EDocument."Entry No"); @@ -533,7 +533,7 @@ codeunit 139883 "E-Doc Process Test" PurchaseLine: Record "Purchase Line"; PurchaseInvoiceLine: Record "Purch. Inv. Line"; EDocument: Record "E-Document"; - EDocImportParams: Record "E-Doc. Import Parameters"; + TempEDocImportParams: Record "E-Doc. Import Parameters"; PurchaseHeader: Record "Purchase Header"; EDocPurchLineField: Record "E-Document Line - Field"; EDocPurchaseLine: Record "E-Document Purchase Line"; @@ -550,9 +550,9 @@ codeunit 139883 "E-Doc Process Test" EDocPurchLineFieldSetup."Field No." := PurchaseInvoiceLine.FieldNo("IC Partner Code"); EDocPurchLineFieldSetup.Insert(); // [GIVEN] An inbound e-document is received and a draft created - EDocImportParams."Step to Run" := "Import E-Document Steps"::"Prepare draft"; + TempEDocImportParams."Step to Run" := "Import E-Document Steps"::"Prepare draft"; WorkDate(DMY2Date(1, 1, 2027)); // Peppol document date is in 2026 - Assert.IsTrue(LibraryEDoc.CreateInboundPEPPOLDocumentToState(EDocument, EDocumentService, 'peppol/peppol-invoice-0.xml', EDocImportParams), 'The draft for the e-document should be created'); + Assert.IsTrue(LibraryEDoc.CreateInboundPEPPOLDocumentToState(EDocument, EDocumentService, 'peppol/peppol-invoice-0.xml', TempEDocImportParams), 'The draft for the e-document should be created'); // [GIVEN] Custom values for the additional fields of the first line are configured EDocPurchLineField."E-Document Entry No." := EDocument."Entry No"; @@ -568,8 +568,8 @@ codeunit 139883 "E-Doc Process Test" // [WHEN] Removing the general setup for the additional fields EDocPurchLineFieldSetup.DeleteAll(); // [WHEN] Creating a purchase invoice from the draft - EDocImportParams."Step to Run" := "Import E-Document Steps"::"Finish draft"; - Assert.IsTrue(EDocImport.ProcessIncomingEDocument(EDocument, EDocImportParams), 'The e-document should be processed'); + TempEDocImportParams."Step to Run" := "Import E-Document Steps"::"Finish draft"; + Assert.IsTrue(EDocImport.ProcessIncomingEDocument(EDocument, TempEDocImportParams), 'The e-document should be processed'); // [THEN] The additional fields should not be set on the purchase invoice line EDocument.Get(EDocument."Entry No"); @@ -586,7 +586,7 @@ codeunit 139883 "E-Doc Process Test" EDocument: Record "E-Document"; EDocumentPurchaseHeader: Record "E-Document Purchase Header"; EDocumentPurchaseLine: Record "E-Document Purchase Line"; - EDocImportParameters: Record "E-Doc. Import Parameters"; + TempEDocImportParameters: Record "E-Doc. Import Parameters"; Vendor2: Record Vendor; CompanyInformation: Record "Company Information"; Item: Record Item; @@ -615,10 +615,10 @@ codeunit 139883 "E-Doc Process Test" EDocumentPurchaseLine.Insert(); EDocumentProcessing.ModifyEDocumentProcessingStatus(EDocument, "Import E-Doc. Proc. Status"::"Ready for draft"); - EDocImportParameters."Step to Run" := "Import E-Document Steps"::"Prepare draft"; + TempEDocImportParameters."Step to Run" := "Import E-Document Steps"::"Prepare draft"; // [WHEN] Filling in the draft - EDocImport.ProcessIncomingEDocument(EDocument, EDocImportParameters); + EDocImport.ProcessIncomingEDocument(EDocument, TempEDocImportParameters); EDocumentPurchaseLine.SetRecFilter(); EDocumentPurchaseLine.FindFirst(); @@ -645,7 +645,7 @@ codeunit 139883 "E-Doc Process Test" EDocument: Record "E-Document"; EDocumentPurchaseHeader: Record "E-Document Purchase Header"; EDocumentPurchaseLine: Record "E-Document Purchase Line"; - EDocImportParameters: Record "E-Doc. Import Parameters"; + TempEDocImportParameters: Record "E-Doc. Import Parameters"; Vendor2: Record Vendor; CompanyInformation: Record "Company Information"; Item: Record Item; @@ -680,10 +680,10 @@ codeunit 139883 "E-Doc Process Test" ItemReference.Modify(); EDocumentProcessing.ModifyEDocumentProcessingStatus(EDocument, "Import E-Doc. Proc. Status"::"Ready for draft"); - EDocImportParameters."Step to Run" := "Import E-Document Steps"::"Prepare draft"; + TempEDocImportParameters."Step to Run" := "Import E-Document Steps"::"Prepare draft"; // [WHEN] Filling in the draft - EDocImport.ProcessIncomingEDocument(EDocument, EDocImportParameters); + EDocImport.ProcessIncomingEDocument(EDocument, TempEDocImportParameters); EDocumentPurchaseLine.SetRecFilter(); EDocumentPurchaseLine.FindFirst(); diff --git a/src/Apps/W1/EDocument/Test/src/Processing/EDocumentStructuredTests.Codeunit.al b/src/Apps/W1/EDocument/Test/src/Processing/EDocumentStructuredTests.Codeunit.al index 67a27ae43e..56bb815791 100644 --- a/src/Apps/W1/EDocument/Test/src/Processing/EDocumentStructuredTests.Codeunit.al +++ b/src/Apps/W1/EDocument/Test/src/Processing/EDocumentStructuredTests.Codeunit.al @@ -290,13 +290,13 @@ codeunit 139891 "E-Document Structured Tests" local procedure ProcessEDocumentToStep(var EDocument: Record "E-Document"; ProcessingStep: Enum "Import E-Document Steps"): Boolean var - EDocImportParameters: Record "E-Doc. Import Parameters"; + TempEDocImportParameters: Record "E-Doc. Import Parameters"; EDocImport: Codeunit "E-Doc. Import"; EDocumentProcessing: Codeunit "E-Document Processing"; begin EDocumentProcessing.ModifyEDocumentProcessingStatus(EDocument, "Import E-Doc. Proc. Status"::Readable); - EDocImportParameters."Step to Run" := ProcessingStep; - EDocImport.ProcessIncomingEDocument(EDocument, EDocImportParameters); + TempEDocImportParameters."Step to Run" := ProcessingStep; + EDocImport.ProcessIncomingEDocument(EDocument, TempEDocImportParameters); EDocument.CalcFields("Import Processing Status"); exit(EDocument."Import Processing Status" = Enum::"Import E-Doc. Proc. Status"::"Ready for draft"); end; diff --git a/src/Apps/W1/ErrorMessagesWithRecommendations/Test/ErrorMessageExtensibilityTests.Codeunit.al b/src/Apps/W1/ErrorMessagesWithRecommendations/Test/ErrorMessageExtensibilityTests.Codeunit.al index 535cdd0f9b..bd3cc878be 100644 --- a/src/Apps/W1/ErrorMessagesWithRecommendations/Test/ErrorMessageExtensibilityTests.Codeunit.al +++ b/src/Apps/W1/ErrorMessagesWithRecommendations/Test/ErrorMessageExtensibilityTests.Codeunit.al @@ -407,12 +407,12 @@ codeunit 139621 ErrorMessageExtensibilityTests local procedure MockFullBatchCheck(TemplateName: Code[10]; BatchName: Code[10]; var TempErrorMessage: Record "Error Message" temporary) var - ErrorHandlingParameters: Record "Error Handling Parameters"; + TempErrorHandlingParameters: Record "Error Handling Parameters"; CheckGenJnlLineBackgr: Codeunit "Check Gen. Jnl. Line. Backgr."; Params: Dictionary of [Text, Text]; begin - SetErrorHandlingParameters(ErrorHandlingParameters, TemplateName, BatchName, '', 0D, '', 0D, true, false); - ErrorHandlingParameters.ToArgs(Params); + SetErrorHandlingParameters(TempErrorHandlingParameters, TemplateName, BatchName, '', 0D, '', 0D, true, false); + TempErrorHandlingParameters.ToArgs(Params); Commit(); CheckGenJnlLineBackgr.RunCheck(Params, TempErrorMessage); end; diff --git a/src/Apps/W1/ExcelReports/App/src/Customer/EXRCustomerTopList.Report.al b/src/Apps/W1/ExcelReports/App/src/Customer/EXRCustomerTopList.Report.al index 9a7970efd5..2dccb6d438 100644 --- a/src/Apps/W1/ExcelReports/App/src/Customer/EXRCustomerTopList.Report.al +++ b/src/Apps/W1/ExcelReports/App/src/Customer/EXRCustomerTopList.Report.al @@ -130,7 +130,9 @@ report 4409 "EXR Customer Top List" DateFilter: Text; protected var +#pragma warning disable AA0073 GlobalExtTopCustomerReportBuffer: Record "EXR Top Customer Report Buffer"; +#pragma warning restore AA0073 EXTTopCustomerCaptionHandler: Codeunit "EXT Top Cust. Caption Handler"; NoOfRecordsToPrint: Integer; diff --git a/src/Apps/W1/ExcelReports/App/src/Customer/ExtTopCustCaptionHandler.Codeunit.al b/src/Apps/W1/ExcelReports/App/src/Customer/ExtTopCustCaptionHandler.Codeunit.al index 1b99263a59..55512c755e 100644 --- a/src/Apps/W1/ExcelReports/App/src/Customer/ExtTopCustCaptionHandler.Codeunit.al +++ b/src/Apps/W1/ExcelReports/App/src/Customer/ExtTopCustCaptionHandler.Codeunit.al @@ -13,7 +13,7 @@ codeunit 4405 "EXT Top Cust. Caption Handler" [EventSubscriber(ObjectType::Table, Database::"EXR Top Customer Report Buffer", 'OnGetAmount1Caption', '', false, false)] local procedure GetAmount1Caption(var NewCaption: Text; var Handled: Boolean) begin - if (EXTTopReportBuffer."Ranking Based On" = EXTTopReportBuffer."Ranking Based On"::"Balance (LCY)") then begin + if (TempEXTTopReportBuffer."Ranking Based On" = TempEXTTopReportBuffer."Ranking Based On"::"Balance (LCY)") then begin NewCaption := BalanceLCYTok; Handled := true; exit; @@ -26,7 +26,7 @@ codeunit 4405 "EXT Top Cust. Caption Handler" [EventSubscriber(ObjectType::Table, Database::"EXR Top Customer Report Buffer", 'OnGetAmount2Caption', '', false, false)] local procedure GetAmount2Caption(var NewCaption: Text; var Handled: Boolean) begin - if EXTTopReportBuffer."Ranking Based On" <> EXTTopReportBuffer."Ranking Based On"::"Balance (LCY)" then begin + if TempEXTTopReportBuffer."Ranking Based On" <> TempEXTTopReportBuffer."Ranking Based On"::"Balance (LCY)" then begin NewCaption := BalanceLCYTok; Handled := true; exit; @@ -38,11 +38,11 @@ codeunit 4405 "EXT Top Cust. Caption Handler" internal procedure SetRankingBasedOn(NewRankingBasedOn: Option) begin - EXTTopReportBuffer."Ranking Based On" := NewRankingBasedOn; + TempEXTTopReportBuffer."Ranking Based On" := NewRankingBasedOn; end; var - EXTTopReportBuffer: Record "EXR Top Customer Report Buffer"; + TempEXTTopReportBuffer: Record "EXR Top Customer Report Buffer"; BalanceLCYTok: Label 'Balance (LCY)'; SalesLCYTok: Label 'Sales (LCY)'; diff --git a/src/Apps/W1/ExcelReports/App/src/Financials/EXTAgedAccCaptionHandler.Codeunit.al b/src/Apps/W1/ExcelReports/App/src/Financials/EXTAgedAccCaptionHandler.Codeunit.al index 2ad3835c04..dc51474a4d 100644 --- a/src/Apps/W1/ExcelReports/App/src/Financials/EXTAgedAccCaptionHandler.Codeunit.al +++ b/src/Apps/W1/ExcelReports/App/src/Financials/EXTAgedAccCaptionHandler.Codeunit.al @@ -13,14 +13,14 @@ codeunit 4406 "EXT Aged Acc. Caption Handler" [EventSubscriber(ObjectType::Table, Database::"EXR Aging Report Buffer", 'OnOverrideAgedBy', '', false, false)] local procedure HandleOverrideAgedBy(var EXRAgingReportBuffer: Record "EXR Aging Report Buffer" temporary) begin - EXRAgingReportBuffer."Aged By" := GlobalEXRAgingReportBuffer."Aged By"; + EXRAgingReportBuffer."Aged By" := TempGlobalEXRAgingReportBuffer."Aged By"; end; internal procedure SetGlobalEXRAgingReportBuffer(var EXRAgingReportBuffer: Record "EXR Aging Report Buffer" temporary) begin - GlobalEXRAgingReportBuffer.Copy(EXRAgingReportBuffer); + TempGlobalEXRAgingReportBuffer.Copy(EXRAgingReportBuffer); end; var - GlobalEXRAgingReportBuffer: Record "EXR Aging Report Buffer"; + TempGlobalEXRAgingReportBuffer: Record "EXR Aging Report Buffer"; } \ No newline at end of file diff --git a/src/Apps/W1/ExcelReports/App/src/Vendor/EXRVendorTopList.Report.al b/src/Apps/W1/ExcelReports/App/src/Vendor/EXRVendorTopList.Report.al index acb5730752..2f8599d6cb 100644 --- a/src/Apps/W1/ExcelReports/App/src/Vendor/EXRVendorTopList.Report.al +++ b/src/Apps/W1/ExcelReports/App/src/Vendor/EXRVendorTopList.Report.al @@ -131,7 +131,9 @@ report 4404 "EXR Vendor Top List" DateFilter: Text; protected var +#pragma warning disable AA0073 GlobalExtTopVendorReportBuffer: Record "EXR Top Vendor Report Buffer"; +#pragma warning restore AA0073 EXTTopVendorCaptionHandler: Codeunit "EXT Top Vendor Caption Handler"; NoOfRecordsToPrint: Integer; diff --git a/src/Apps/W1/ExcelReports/App/src/Vendor/ExtTopVendorCaptionHandler.Codeunit.al b/src/Apps/W1/ExcelReports/App/src/Vendor/ExtTopVendorCaptionHandler.Codeunit.al index 94e3bb1142..bf92ebc70b 100644 --- a/src/Apps/W1/ExcelReports/App/src/Vendor/ExtTopVendorCaptionHandler.Codeunit.al +++ b/src/Apps/W1/ExcelReports/App/src/Vendor/ExtTopVendorCaptionHandler.Codeunit.al @@ -13,7 +13,7 @@ codeunit 4404 "EXT Top Vendor Caption Handler" [EventSubscriber(ObjectType::Table, Database::"EXR Top Vendor Report Buffer", 'OnGetAmount1Caption', '', false, false)] local procedure GetAmount1Caption(var NewCaption: Text; var Handled: Boolean) begin - if (EXTTopReportBuffer."Ranking Based On" = EXTTopReportBuffer."Ranking Based On"::"Balance (LCY)") then begin + if (TempEXTTopReportBuffer."Ranking Based On" = TempEXTTopReportBuffer."Ranking Based On"::"Balance (LCY)") then begin NewCaption := BalanceLCYTok; Handled := true; exit; @@ -26,7 +26,7 @@ codeunit 4404 "EXT Top Vendor Caption Handler" [EventSubscriber(ObjectType::Table, Database::"EXR Top Vendor Report Buffer", 'OnGetAmount2Caption', '', false, false)] local procedure GetAmount2Caption(var NewCaption: Text; var Handled: Boolean) begin - if EXTTopReportBuffer."Ranking Based On" <> EXTTopReportBuffer."Ranking Based On"::"Balance (LCY)" then begin + if TempEXTTopReportBuffer."Ranking Based On" <> TempEXTTopReportBuffer."Ranking Based On"::"Balance (LCY)" then begin NewCaption := BalanceLCYTok; Handled := true; exit; @@ -38,11 +38,11 @@ codeunit 4404 "EXT Top Vendor Caption Handler" internal procedure SetRankingBasedOn(NewRankingBasedOn: Option) begin - EXTTopReportBuffer."Ranking Based On" := NewRankingBasedOn; + TempEXTTopReportBuffer."Ranking Based On" := NewRankingBasedOn; end; var - EXTTopReportBuffer: Record "EXR Top Vendor Report Buffer"; + TempEXTTopReportBuffer: Record "EXR Top Vendor Report Buffer"; BalanceLCYTok: Label 'Balance (LCY)'; PurchasesLCYTok: Label 'Purchases (LCY)'; diff --git a/src/Apps/W1/ExcelReports/Test/src/TrialBalanceExcelReports.Codeunit.al b/src/Apps/W1/ExcelReports/Test/src/TrialBalanceExcelReports.Codeunit.al index 5df379f161..396306cc9e 100644 --- a/src/Apps/W1/ExcelReports/Test/src/TrialBalanceExcelReports.Codeunit.al +++ b/src/Apps/W1/ExcelReports/Test/src/TrialBalanceExcelReports.Codeunit.al @@ -309,7 +309,7 @@ codeunit 139544 "Trial Balance Excel Reports" [Test] procedure TrialBalanceBufferNetChangeSplitsIntoDebitAndCreditWhenCalledSeveralTimes() var - EXRTrialBalanceBuffer: Record "EXR Trial Balance Buffer"; + TempEXRTrialBalanceBuffer: Record "EXR Trial Balance Buffer"; ValuesToSplitInCreditAndDebit: array[3] of Decimal; begin // [SCENARIO 547558] Trial Balance Buffer data split into Debit and Credit correctly, even if called multiple times. @@ -320,52 +320,52 @@ codeunit 139544 "Trial Balance Excel Reports" // [GIVEN] Trial Balance Buffer filled with positive Balance/Net Change ValuesToSplitInCreditAndDebit[3] := 998; // [WHEN] Trial Balance Buffer entries are inserted - EXRTrialBalanceBuffer."G/L Account No." := 'A'; - EXRTrialBalanceBuffer.Validate("Starting Balance", ValuesToSplitInCreditAndDebit[1]); - EXRTrialBalanceBuffer.Validate("Net Change", ValuesToSplitInCreditAndDebit[1]); - EXRTrialBalanceBuffer.Validate(Balance, ValuesToSplitInCreditAndDebit[1]); - EXRTrialBalanceBuffer.Validate("Starting Balance (ACY)", ValuesToSplitInCreditAndDebit[1]); - EXRTrialBalanceBuffer.Validate("Net Change (ACY)", ValuesToSplitInCreditAndDebit[1]); - EXRTrialBalanceBuffer.Validate("Balance (ACY)", ValuesToSplitInCreditAndDebit[1]); - EXRTrialBalanceBuffer.Insert(); - EXRTrialBalanceBuffer."G/L Account No." := 'B'; - EXRTrialBalanceBuffer.Validate("Starting Balance", ValuesToSplitInCreditAndDebit[2]); - EXRTrialBalanceBuffer.Validate("Net Change", ValuesToSplitInCreditAndDebit[2]); - EXRTrialBalanceBuffer.Validate(Balance, ValuesToSplitInCreditAndDebit[2]); - EXRTrialBalanceBuffer.Validate("Starting Balance (ACY)", ValuesToSplitInCreditAndDebit[2]); - EXRTrialBalanceBuffer.Validate("Net Change (ACY)", ValuesToSplitInCreditAndDebit[2]); - EXRTrialBalanceBuffer.Validate("Balance (ACY)", ValuesToSplitInCreditAndDebit[2]); - EXRTrialBalanceBuffer.Insert(); - EXRTrialBalanceBuffer."G/L Account No." := 'C'; - EXRTrialBalanceBuffer.Validate("Starting Balance", ValuesToSplitInCreditAndDebit[3]); - EXRTrialBalanceBuffer.Validate("Net Change", ValuesToSplitInCreditAndDebit[3]); - EXRTrialBalanceBuffer.Validate(Balance, ValuesToSplitInCreditAndDebit[3]); - EXRTrialBalanceBuffer.Validate("Starting Balance (ACY)", ValuesToSplitInCreditAndDebit[3]); - EXRTrialBalanceBuffer.Validate("Net Change (ACY)", ValuesToSplitInCreditAndDebit[3]); - EXRTrialBalanceBuffer.Validate("Balance (ACY)", ValuesToSplitInCreditAndDebit[3]); - EXRTrialBalanceBuffer.Insert(); + TempEXRTrialBalanceBuffer."G/L Account No." := 'A'; + TempEXRTrialBalanceBuffer.Validate("Starting Balance", ValuesToSplitInCreditAndDebit[1]); + TempEXRTrialBalanceBuffer.Validate("Net Change", ValuesToSplitInCreditAndDebit[1]); + TempEXRTrialBalanceBuffer.Validate(Balance, ValuesToSplitInCreditAndDebit[1]); + TempEXRTrialBalanceBuffer.Validate("Starting Balance (ACY)", ValuesToSplitInCreditAndDebit[1]); + TempEXRTrialBalanceBuffer.Validate("Net Change (ACY)", ValuesToSplitInCreditAndDebit[1]); + TempEXRTrialBalanceBuffer.Validate("Balance (ACY)", ValuesToSplitInCreditAndDebit[1]); + TempEXRTrialBalanceBuffer.Insert(); + TempEXRTrialBalanceBuffer."G/L Account No." := 'B'; + TempEXRTrialBalanceBuffer.Validate("Starting Balance", ValuesToSplitInCreditAndDebit[2]); + TempEXRTrialBalanceBuffer.Validate("Net Change", ValuesToSplitInCreditAndDebit[2]); + TempEXRTrialBalanceBuffer.Validate(Balance, ValuesToSplitInCreditAndDebit[2]); + TempEXRTrialBalanceBuffer.Validate("Starting Balance (ACY)", ValuesToSplitInCreditAndDebit[2]); + TempEXRTrialBalanceBuffer.Validate("Net Change (ACY)", ValuesToSplitInCreditAndDebit[2]); + TempEXRTrialBalanceBuffer.Validate("Balance (ACY)", ValuesToSplitInCreditAndDebit[2]); + TempEXRTrialBalanceBuffer.Insert(); + TempEXRTrialBalanceBuffer."G/L Account No." := 'C'; + TempEXRTrialBalanceBuffer.Validate("Starting Balance", ValuesToSplitInCreditAndDebit[3]); + TempEXRTrialBalanceBuffer.Validate("Net Change", ValuesToSplitInCreditAndDebit[3]); + TempEXRTrialBalanceBuffer.Validate(Balance, ValuesToSplitInCreditAndDebit[3]); + TempEXRTrialBalanceBuffer.Validate("Starting Balance (ACY)", ValuesToSplitInCreditAndDebit[3]); + TempEXRTrialBalanceBuffer.Validate("Net Change (ACY)", ValuesToSplitInCreditAndDebit[3]); + TempEXRTrialBalanceBuffer.Validate("Balance (ACY)", ValuesToSplitInCreditAndDebit[3]); + TempEXRTrialBalanceBuffer.Insert(); // [THEN] All Entries have the right split in Credit and Debit - EXRTrialBalanceBuffer.FindSet(); - Assert.AreEqual(ValuesToSplitInCreditAndDebit[1], Abs(EXRTrialBalanceBuffer."Starting Balance (Debit)" + EXRTrialBalanceBuffer."Starting Balance (Credit)"), 'Split in line in credit and debit should be the same as the inserted value.'); - Assert.AreEqual(ValuesToSplitInCreditAndDebit[1], Abs(EXRTrialBalanceBuffer."Net Change (Debit)" + EXRTrialBalanceBuffer."Net Change (Credit)"), 'Split in line in credit and debit should be the same as the inserted value.'); - Assert.AreEqual(ValuesToSplitInCreditAndDebit[1], Abs(EXRTrialBalanceBuffer."Balance (Debit)" + EXRTrialBalanceBuffer."Balance (Credit)"), 'Split in line in credit and debit should be the same as the inserted value.'); - Assert.AreEqual(ValuesToSplitInCreditAndDebit[1], Abs(EXRTrialBalanceBuffer."Starting Balance (Debit) (ACY)" + EXRTrialBalanceBuffer."Starting Balance (Credit)(ACY)"), 'Split in line in credit and debit should be the same as the inserted value.'); - Assert.AreEqual(ValuesToSplitInCreditAndDebit[1], Abs(EXRTrialBalanceBuffer."Net Change (Debit) (ACY)" + EXRTrialBalanceBuffer."Net Change (Credit) (ACY)"), 'Split in line in credit and debit should be the same as the inserted value.'); - Assert.AreEqual(ValuesToSplitInCreditAndDebit[1], Abs(EXRTrialBalanceBuffer."Balance (Debit) (ACY)" + EXRTrialBalanceBuffer."Balance (Credit) (ACY)"), 'Split in line in credit and debit should be the same as the inserted value.'); - EXRTrialBalanceBuffer.Next(); - Assert.AreEqual(-ValuesToSplitInCreditAndDebit[2], Abs(EXRTrialBalanceBuffer."Starting Balance (Debit)" + EXRTrialBalanceBuffer."Starting Balance (Credit)"), 'Split in line in credit and debit should be the same as the inserted value.'); - Assert.AreEqual(-ValuesToSplitInCreditAndDebit[2], Abs(EXRTrialBalanceBuffer."Net Change (Debit)" + EXRTrialBalanceBuffer."Net Change (Credit)"), 'Split in line in credit and debit should be the same as the inserted value.'); - Assert.AreEqual(-ValuesToSplitInCreditAndDebit[2], Abs(EXRTrialBalanceBuffer."Balance (Debit)" + EXRTrialBalanceBuffer."Balance (Credit)"), 'Split in line in credit and debit should be the same as the inserted value.'); - Assert.AreEqual(-ValuesToSplitInCreditAndDebit[2], Abs(EXRTrialBalanceBuffer."Starting Balance (Debit) (ACY)" + EXRTrialBalanceBuffer."Starting Balance (Credit)(ACY)"), 'Split in line in credit and debit should be the same as the inserted value.'); - Assert.AreEqual(-ValuesToSplitInCreditAndDebit[2], Abs(EXRTrialBalanceBuffer."Net Change (Debit) (ACY)" + EXRTrialBalanceBuffer."Net Change (Credit) (ACY)"), 'Split in line in credit and debit should be the same as the inserted value.'); - Assert.AreEqual(-ValuesToSplitInCreditAndDebit[2], Abs(EXRTrialBalanceBuffer."Balance (Debit) (ACY)" + EXRTrialBalanceBuffer."Balance (Credit) (ACY)"), 'Split in line in credit and debit should be the same as the inserted value.'); - EXRTrialBalanceBuffer.Next(); - Assert.AreEqual(ValuesToSplitInCreditAndDebit[3], Abs(EXRTrialBalanceBuffer."Starting Balance (Debit)" + EXRTrialBalanceBuffer."Starting Balance (Credit)"), 'Split in line in credit and debit should be the same as the inserted value.'); - Assert.AreEqual(ValuesToSplitInCreditAndDebit[3], Abs(EXRTrialBalanceBuffer."Net Change (Debit)" + EXRTrialBalanceBuffer."Net Change (Credit)"), 'Split in line in credit and debit should be the same as the inserted value.'); - Assert.AreEqual(ValuesToSplitInCreditAndDebit[3], Abs(EXRTrialBalanceBuffer."Balance (Debit)" + EXRTrialBalanceBuffer."Balance (Credit)"), 'Split in line in credit and debit should be the same as the inserted value.'); - Assert.AreEqual(ValuesToSplitInCreditAndDebit[3], Abs(EXRTrialBalanceBuffer."Starting Balance (Debit) (ACY)" + EXRTrialBalanceBuffer."Starting Balance (Credit)(ACY)"), 'Split in line in credit and debit should be the same as the inserted value.'); - Assert.AreEqual(ValuesToSplitInCreditAndDebit[3], Abs(EXRTrialBalanceBuffer."Net Change (Debit) (ACY)" + EXRTrialBalanceBuffer."Net Change (Credit) (ACY)"), 'Split in line in credit and debit should be the same as the inserted value.'); - Assert.AreEqual(ValuesToSplitInCreditAndDebit[3], Abs(EXRTrialBalanceBuffer."Balance (Debit) (ACY)" + EXRTrialBalanceBuffer."Balance (Credit) (ACY)"), 'Split in line in credit and debit should be the same as the inserted value.'); + TempEXRTrialBalanceBuffer.FindSet(); + Assert.AreEqual(ValuesToSplitInCreditAndDebit[1], Abs(TempEXRTrialBalanceBuffer."Starting Balance (Debit)" + TempEXRTrialBalanceBuffer."Starting Balance (Credit)"), 'Split in line in credit and debit should be the same as the inserted value.'); + Assert.AreEqual(ValuesToSplitInCreditAndDebit[1], Abs(TempEXRTrialBalanceBuffer."Net Change (Debit)" + TempEXRTrialBalanceBuffer."Net Change (Credit)"), 'Split in line in credit and debit should be the same as the inserted value.'); + Assert.AreEqual(ValuesToSplitInCreditAndDebit[1], Abs(TempEXRTrialBalanceBuffer."Balance (Debit)" + TempEXRTrialBalanceBuffer."Balance (Credit)"), 'Split in line in credit and debit should be the same as the inserted value.'); + Assert.AreEqual(ValuesToSplitInCreditAndDebit[1], Abs(TempEXRTrialBalanceBuffer."Starting Balance (Debit) (ACY)" + TempEXRTrialBalanceBuffer."Starting Balance (Credit)(ACY)"), 'Split in line in credit and debit should be the same as the inserted value.'); + Assert.AreEqual(ValuesToSplitInCreditAndDebit[1], Abs(TempEXRTrialBalanceBuffer."Net Change (Debit) (ACY)" + TempEXRTrialBalanceBuffer."Net Change (Credit) (ACY)"), 'Split in line in credit and debit should be the same as the inserted value.'); + Assert.AreEqual(ValuesToSplitInCreditAndDebit[1], Abs(TempEXRTrialBalanceBuffer."Balance (Debit) (ACY)" + TempEXRTrialBalanceBuffer."Balance (Credit) (ACY)"), 'Split in line in credit and debit should be the same as the inserted value.'); + TempEXRTrialBalanceBuffer.Next(); + Assert.AreEqual(-ValuesToSplitInCreditAndDebit[2], Abs(TempEXRTrialBalanceBuffer."Starting Balance (Debit)" + TempEXRTrialBalanceBuffer."Starting Balance (Credit)"), 'Split in line in credit and debit should be the same as the inserted value.'); + Assert.AreEqual(-ValuesToSplitInCreditAndDebit[2], Abs(TempEXRTrialBalanceBuffer."Net Change (Debit)" + TempEXRTrialBalanceBuffer."Net Change (Credit)"), 'Split in line in credit and debit should be the same as the inserted value.'); + Assert.AreEqual(-ValuesToSplitInCreditAndDebit[2], Abs(TempEXRTrialBalanceBuffer."Balance (Debit)" + TempEXRTrialBalanceBuffer."Balance (Credit)"), 'Split in line in credit and debit should be the same as the inserted value.'); + Assert.AreEqual(-ValuesToSplitInCreditAndDebit[2], Abs(TempEXRTrialBalanceBuffer."Starting Balance (Debit) (ACY)" + TempEXRTrialBalanceBuffer."Starting Balance (Credit)(ACY)"), 'Split in line in credit and debit should be the same as the inserted value.'); + Assert.AreEqual(-ValuesToSplitInCreditAndDebit[2], Abs(TempEXRTrialBalanceBuffer."Net Change (Debit) (ACY)" + TempEXRTrialBalanceBuffer."Net Change (Credit) (ACY)"), 'Split in line in credit and debit should be the same as the inserted value.'); + Assert.AreEqual(-ValuesToSplitInCreditAndDebit[2], Abs(TempEXRTrialBalanceBuffer."Balance (Debit) (ACY)" + TempEXRTrialBalanceBuffer."Balance (Credit) (ACY)"), 'Split in line in credit and debit should be the same as the inserted value.'); + TempEXRTrialBalanceBuffer.Next(); + Assert.AreEqual(ValuesToSplitInCreditAndDebit[3], Abs(TempEXRTrialBalanceBuffer."Starting Balance (Debit)" + TempEXRTrialBalanceBuffer."Starting Balance (Credit)"), 'Split in line in credit and debit should be the same as the inserted value.'); + Assert.AreEqual(ValuesToSplitInCreditAndDebit[3], Abs(TempEXRTrialBalanceBuffer."Net Change (Debit)" + TempEXRTrialBalanceBuffer."Net Change (Credit)"), 'Split in line in credit and debit should be the same as the inserted value.'); + Assert.AreEqual(ValuesToSplitInCreditAndDebit[3], Abs(TempEXRTrialBalanceBuffer."Balance (Debit)" + TempEXRTrialBalanceBuffer."Balance (Credit)"), 'Split in line in credit and debit should be the same as the inserted value.'); + Assert.AreEqual(ValuesToSplitInCreditAndDebit[3], Abs(TempEXRTrialBalanceBuffer."Starting Balance (Debit) (ACY)" + TempEXRTrialBalanceBuffer."Starting Balance (Credit)(ACY)"), 'Split in line in credit and debit should be the same as the inserted value.'); + Assert.AreEqual(ValuesToSplitInCreditAndDebit[3], Abs(TempEXRTrialBalanceBuffer."Net Change (Debit) (ACY)" + TempEXRTrialBalanceBuffer."Net Change (Credit) (ACY)"), 'Split in line in credit and debit should be the same as the inserted value.'); + Assert.AreEqual(ValuesToSplitInCreditAndDebit[3], Abs(TempEXRTrialBalanceBuffer."Balance (Debit) (ACY)" + TempEXRTrialBalanceBuffer."Balance (Credit) (ACY)"), 'Split in line in credit and debit should be the same as the inserted value.'); end; [Test] @@ -373,7 +373,7 @@ codeunit 139544 "Trial Balance Excel Reports" var GLAccount: Record "G/L Account"; TempDimensionValue: Record "Dimension Value" temporary; - TrialBalanceData: Record "EXR Trial Balance Buffer"; + TempTrialBalanceData: Record "EXR Trial Balance Buffer"; TrialBalance: Codeunit "Trial Balance"; PostingAccount: Code[20]; BeforePeriodAmount: Decimal; @@ -393,14 +393,14 @@ codeunit 139544 "Trial Balance Excel Reports" GLAccount.SetRange("No.", PostingAccount); GLAccount.SetRange("Date Filter", DMY2Date(1, 1, Date2DMY(WorkDate(), 3)), DMY2Date(31, 12, Date2DMY(WorkDate(), 3))); TrialBalance.ConfigureTrialBalance(false, false); - TrialBalance.InsertTrialBalanceReportData(GLAccount, TempDimensionValue, TempDimensionValue, TrialBalanceData); + TrialBalance.InsertTrialBalanceReportData(GLAccount, TempDimensionValue, TempDimensionValue, TempTrialBalanceData); // [THEN] The buffer has correct amounts - TrialBalanceData.SetRange("G/L Account No.", PostingAccount); - Assert.IsTrue(TrialBalanceData.FindFirst(), 'Buffer record should exist for the posting account'); - Assert.AreEqual(BeforePeriodAmount, TrialBalanceData."Starting Balance", 'Starting Balance should equal the entry before the period'); - Assert.AreEqual(InPeriodAmount, TrialBalanceData."Net Change", 'Net Change should equal the entry within the period'); - Assert.AreEqual(BeforePeriodAmount + InPeriodAmount, TrialBalanceData.Balance, 'Balance should equal Starting Balance + Net Change'); + TempTrialBalanceData.SetRange("G/L Account No.", PostingAccount); + Assert.IsTrue(TempTrialBalanceData.FindFirst(), 'Buffer record should exist for the posting account'); + Assert.AreEqual(BeforePeriodAmount, TempTrialBalanceData."Starting Balance", 'Starting Balance should equal the entry before the period'); + Assert.AreEqual(InPeriodAmount, TempTrialBalanceData."Net Change", 'Net Change should equal the entry within the period'); + Assert.AreEqual(BeforePeriodAmount + InPeriodAmount, TempTrialBalanceData.Balance, 'Balance should equal Starting Balance + Net Change'); end; [Test] @@ -410,7 +410,7 @@ codeunit 139544 "Trial Balance Excel Reports" Dimension: Record Dimension; DimensionValue1, DimensionValue2 : Record "Dimension Value"; TempDimension1Values, TempDimension2Values : Record "Dimension Value" temporary; - TrialBalanceData: Record "EXR Trial Balance Buffer"; + TempTrialBalanceData: Record "EXR Trial Balance Buffer"; TrialBalance: Codeunit "Trial Balance"; Amount1Dim1, Amount2Dim1, Amount1Dim2 : Decimal; begin @@ -444,29 +444,29 @@ codeunit 139544 "Trial Balance Excel Reports" // [WHEN] Running the trial balance for the current year GLAccount.SetRange("Date Filter", DMY2Date(1, 1, Date2DMY(WorkDate(), 3)), DMY2Date(31, 12, Date2DMY(WorkDate(), 3))); TrialBalance.ConfigureTrialBalance(false, false); - TrialBalance.InsertTrialBalanceReportData(GLAccount, TempDimension1Values, TempDimension2Values, TrialBalanceData); + TrialBalance.InsertTrialBalanceReportData(GLAccount, TempDimension1Values, TempDimension2Values, TempTrialBalanceData); // [THEN] End-Total has per-dimension rows with correct sums - TrialBalanceData.Reset(); - TrialBalanceData.SetRange("G/L Account No.", EndTotalAccount."No."); - Assert.AreEqual(2, TrialBalanceData.Count(), 'End-Total should have 2 rows (one per Dim2 value)'); + TempTrialBalanceData.Reset(); + TempTrialBalanceData.SetRange("G/L Account No.", EndTotalAccount."No."); + Assert.AreEqual(2, TempTrialBalanceData.Count(), 'End-Total should have 2 rows (one per Dim2 value)'); - TrialBalanceData.SetRange("Dimension 2 Code", DimensionValue1.Code); - TrialBalanceData.FindFirst(); - Assert.AreEqual(Amount1Dim1 + Amount2Dim1, TrialBalanceData.Balance, 'End-Total Dim2=Value1 should sum both posting accounts'); + TempTrialBalanceData.SetRange("Dimension 2 Code", DimensionValue1.Code); + TempTrialBalanceData.FindFirst(); + Assert.AreEqual(Amount1Dim1 + Amount2Dim1, TempTrialBalanceData.Balance, 'End-Total Dim2=Value1 should sum both posting accounts'); - TrialBalanceData.SetRange("Dimension 2 Code", DimensionValue2.Code); - TrialBalanceData.FindFirst(); - Assert.AreEqual(Amount1Dim2, TrialBalanceData.Balance, 'End-Total Dim2=Value2 should have only Account1 amount'); + TempTrialBalanceData.SetRange("Dimension 2 Code", DimensionValue2.Code); + TempTrialBalanceData.FindFirst(); + Assert.AreEqual(Amount1Dim2, TempTrialBalanceData.Balance, 'End-Total Dim2=Value2 should have only Account1 amount'); // [THEN] Total account has identical per-dimension rows - TrialBalanceData.Reset(); - TrialBalanceData.SetRange("G/L Account No.", TotalAccount."No."); - Assert.AreEqual(2, TrialBalanceData.Count(), 'Total should have 2 rows (one per Dim2 value)'); + TempTrialBalanceData.Reset(); + TempTrialBalanceData.SetRange("G/L Account No.", TotalAccount."No."); + Assert.AreEqual(2, TempTrialBalanceData.Count(), 'Total should have 2 rows (one per Dim2 value)'); - TrialBalanceData.SetRange("Dimension 2 Code", DimensionValue1.Code); - TrialBalanceData.FindFirst(); - Assert.AreEqual(Amount1Dim1 + Amount2Dim1, TrialBalanceData.Balance, 'Total Dim2=Value1 should sum both posting accounts'); + TempTrialBalanceData.SetRange("Dimension 2 Code", DimensionValue1.Code); + TempTrialBalanceData.FindFirst(); + Assert.AreEqual(Amount1Dim1 + Amount2Dim1, TempTrialBalanceData.Balance, 'Total Dim2=Value1 should sum both posting accounts'); end; [Test] @@ -476,7 +476,7 @@ codeunit 139544 "Trial Balance Excel Reports" GLBudgetName: Record "G/L Budget Name"; GLBudgetEntry: Record "G/L Budget Entry"; TempDimension1Values, TempDimension2Values : Record "Dimension Value" temporary; - TrialBalanceData: Record "EXR Trial Balance Buffer"; + TempTrialBalanceData: Record "EXR Trial Balance Buffer"; TrialBalance: Codeunit "Trial Balance"; PostingAccount: Code[20]; EntryAmount, BudgetInPeriod, BudgetBeforePeriod : Decimal; @@ -507,13 +507,13 @@ codeunit 139544 "Trial Balance Excel Reports" GLAccount.SetRange("No.", PostingAccount); GLAccount.SetRange("Date Filter", PeriodStart, PeriodEnd); TrialBalance.ConfigureTrialBalance(false, true); - TrialBalance.InsertTrialBalanceReportData(GLAccount, TempDimension1Values, TempDimension2Values, TrialBalanceData); + TrialBalance.InsertTrialBalanceReportData(GLAccount, TempDimension1Values, TempDimension2Values, TempTrialBalanceData); // [THEN] Budget fields are populated - TrialBalanceData.SetRange("G/L Account No.", PostingAccount); - Assert.IsTrue(TrialBalanceData.FindFirst(), 'Buffer record should exist'); - Assert.AreEqual(BudgetInPeriod, TrialBalanceData."Budget (Net)", 'Budget (Net) should be the budget entry within the period'); - Assert.AreEqual(BudgetBeforePeriod + BudgetInPeriod, TrialBalanceData."Budget (Bal. at Date)", 'Budget (Bal. at Date) should be cumulative up to period end'); + TempTrialBalanceData.SetRange("G/L Account No.", PostingAccount); + Assert.IsTrue(TempTrialBalanceData.FindFirst(), 'Buffer record should exist'); + Assert.AreEqual(BudgetInPeriod, TempTrialBalanceData."Budget (Net)", 'Budget (Net) should be the budget entry within the period'); + Assert.AreEqual(BudgetBeforePeriod + BudgetInPeriod, TempTrialBalanceData."Budget (Bal. at Date)", 'Budget (Bal. at Date) should be cumulative up to period end'); end; [Test] @@ -522,7 +522,7 @@ codeunit 139544 "Trial Balance Excel Reports" GLAccount: Record "G/L Account"; BusinessUnit1, BusinessUnit2 : Record "Business Unit"; TempDimension1Values, TempDimension2Values : Record "Dimension Value" temporary; - TrialBalanceData: Record "EXR Trial Balance Buffer"; + TempTrialBalanceData: Record "EXR Trial Balance Buffer"; TrialBalance: Codeunit "Trial Balance"; PostingAccount: Code[20]; AmountBU1, AmountBU2 : Decimal; @@ -544,19 +544,19 @@ codeunit 139544 "Trial Balance Excel Reports" GLAccount.SetRange("No.", PostingAccount); GLAccount.SetRange("Date Filter", DMY2Date(1, 1, Date2DMY(WorkDate(), 3)), DMY2Date(31, 12, Date2DMY(WorkDate(), 3))); TrialBalance.ConfigureTrialBalance(true, false); - TrialBalance.InsertTrialBalanceReportData(GLAccount, TempDimension1Values, TempDimension2Values, TrialBalanceData); + TrialBalance.InsertTrialBalanceReportData(GLAccount, TempDimension1Values, TempDimension2Values, TempTrialBalanceData); // [THEN] Two buffer records exist, one per BU, with correct amounts - TrialBalanceData.SetRange("G/L Account No.", PostingAccount); - Assert.AreEqual(2, TrialBalanceData.Count(), 'Should have one row per Business Unit'); + TempTrialBalanceData.SetRange("G/L Account No.", PostingAccount); + Assert.AreEqual(2, TempTrialBalanceData.Count(), 'Should have one row per Business Unit'); - TrialBalanceData.SetRange("Business Unit Code", BusinessUnit1.Code); - TrialBalanceData.FindFirst(); - Assert.AreEqual(AmountBU1, TrialBalanceData.Balance, 'BU1 balance should match its entries'); + TempTrialBalanceData.SetRange("Business Unit Code", BusinessUnit1.Code); + TempTrialBalanceData.FindFirst(); + Assert.AreEqual(AmountBU1, TempTrialBalanceData.Balance, 'BU1 balance should match its entries'); - TrialBalanceData.SetRange("Business Unit Code", BusinessUnit2.Code); - TrialBalanceData.FindFirst(); - Assert.AreEqual(AmountBU2, TrialBalanceData.Balance, 'BU2 balance should match its entries'); + TempTrialBalanceData.SetRange("Business Unit Code", BusinessUnit2.Code); + TempTrialBalanceData.FindFirst(); + Assert.AreEqual(AmountBU2, TempTrialBalanceData.Balance, 'BU2 balance should match its entries'); end; [Test] @@ -564,7 +564,7 @@ codeunit 139544 "Trial Balance Excel Reports" var GLAccount1, GLAccount2, GLAccount3, GLAccount : Record "G/L Account"; TempDimension1Values, TempDimension2Values : Record "Dimension Value" temporary; - TrialBalanceData: Record "EXR Trial Balance Buffer"; + TempTrialBalanceData: Record "EXR Trial Balance Buffer"; TrialBalance: Codeunit "Trial Balance"; begin // [SCENARIO] The query path only returns data for accounts matching the No. filter. @@ -581,13 +581,13 @@ codeunit 139544 "Trial Balance Excel Reports" GLAccount.SetRange("No.", GLAccount2."No."); GLAccount.SetRange("Date Filter", DMY2Date(1, 1, Date2DMY(WorkDate(), 3)), DMY2Date(31, 12, Date2DMY(WorkDate(), 3))); TrialBalance.ConfigureTrialBalance(false, false); - TrialBalance.InsertTrialBalanceReportData(GLAccount, TempDimension1Values, TempDimension2Values, TrialBalanceData); + TrialBalance.InsertTrialBalanceReportData(GLAccount, TempDimension1Values, TempDimension2Values, TempTrialBalanceData); // [THEN] Only the filtered account appears in the buffer - Assert.AreEqual(1, TrialBalanceData.Count(), 'Only one account should be in the buffer'); - TrialBalanceData.FindFirst(); - Assert.AreEqual(GLAccount2."No.", TrialBalanceData."G/L Account No.", 'The filtered account should be the one returned'); - Assert.AreEqual(200, TrialBalanceData.Balance, 'Amount should match the filtered account entry'); + Assert.AreEqual(1, TempTrialBalanceData.Count(), 'Only one account should be in the buffer'); + TempTrialBalanceData.FindFirst(); + Assert.AreEqual(GLAccount2."No.", TempTrialBalanceData."G/L Account No.", 'The filtered account should be the one returned'); + Assert.AreEqual(200, TempTrialBalanceData.Balance, 'Amount should match the filtered account entry'); end; [Test] @@ -595,7 +595,7 @@ codeunit 139544 "Trial Balance Excel Reports" var GLAccount: Record "G/L Account"; TempDimension1Values, TempDimension2Values : Record "Dimension Value" temporary; - TrialBalanceData: Record "EXR Trial Balance Buffer"; + TempTrialBalanceData: Record "EXR Trial Balance Buffer"; TrialBalance: Codeunit "Trial Balance"; ZeroAccount, NonZeroAccount : Code[20]; begin @@ -615,12 +615,12 @@ codeunit 139544 "Trial Balance Excel Reports" GLAccount.SetFilter("No.", '%1|%2', ZeroAccount, NonZeroAccount); GLAccount.SetRange("Date Filter", DMY2Date(1, 1, Date2DMY(WorkDate(), 3)), DMY2Date(31, 12, Date2DMY(WorkDate(), 3))); TrialBalance.ConfigureTrialBalance(false, false); - TrialBalance.InsertTrialBalanceReportData(GLAccount, TempDimension1Values, TempDimension2Values, TrialBalanceData); + TrialBalance.InsertTrialBalanceReportData(GLAccount, TempDimension1Values, TempDimension2Values, TempTrialBalanceData); // [THEN] Only the non-zero account appears - Assert.AreEqual(1, TrialBalanceData.Count(), 'Only the non-zero account should be in the buffer'); - TrialBalanceData.FindFirst(); - Assert.AreEqual(NonZeroAccount, TrialBalanceData."G/L Account No.", 'The non-zero account should be the one returned'); + Assert.AreEqual(1, TempTrialBalanceData.Count(), 'Only the non-zero account should be in the buffer'); + TempTrialBalanceData.FindFirst(); + Assert.AreEqual(NonZeroAccount, TempTrialBalanceData."G/L Account No.", 'The non-zero account should be the one returned'); end; [Test] @@ -628,7 +628,7 @@ codeunit 139544 "Trial Balance Excel Reports" var GLAccount: Record "G/L Account"; TempDimensionValue: Record "Dimension Value" temporary; - TrialBalanceData: Record "EXR Trial Balance Buffer"; + TempTrialBalanceData: Record "EXR Trial Balance Buffer"; TrialBalance: Codeunit "Trial Balance"; PostingAccount: Code[20]; ActivityAmount: Decimal; @@ -651,12 +651,12 @@ codeunit 139544 "Trial Balance Excel Reports" GLAccount.SetRange("No.", PostingAccount); GLAccount.SetRange("Date Filter", DMY2Date(1, 1, Date2DMY(WorkDate(), 3)), DMY2Date(31, 12, Date2DMY(WorkDate(), 3))); TrialBalance.ConfigureTrialBalance(false, false); - TrialBalance.InsertTrialBalanceReportData(GLAccount, TempDimensionValue, TempDimensionValue, TrialBalanceData); + TrialBalance.InsertTrialBalanceReportData(GLAccount, TempDimensionValue, TempDimensionValue, TempTrialBalanceData); // [THEN] Starting Balance is zero because the closing entry zeroed out the account - TrialBalanceData.SetRange("G/L Account No.", PostingAccount); - TrialBalanceData.FindFirst(); - Assert.AreEqual(0, TrialBalanceData."Starting Balance", 'Starting Balance should be zero after closing entries') + TempTrialBalanceData.SetRange("G/L Account No.", PostingAccount); + TempTrialBalanceData.FindFirst(); + Assert.AreEqual(0, TempTrialBalanceData."Starting Balance", 'Starting Balance should be zero after closing entries') end; local procedure CreateSampleBusinessUnits(HowMany: Integer) diff --git a/src/Apps/W1/External File Storage - Azure Blob Service Connector/App/src/ExtBlobStoConnectorImpl.Codeunit.al b/src/Apps/W1/External File Storage - Azure Blob Service Connector/App/src/ExtBlobStoConnectorImpl.Codeunit.al index a40ca00c6e..e98b514e04 100644 --- a/src/Apps/W1/External File Storage - Azure Blob Service Connector/App/src/ExtBlobStoConnectorImpl.Codeunit.al +++ b/src/Apps/W1/External File Storage - Azure Blob Service Connector/App/src/ExtBlobStoConnectorImpl.Codeunit.al @@ -31,7 +31,7 @@ codeunit 4560 "Ext. Blob Sto. Connector Impl." implements "External File Storage /// A list with all files stored in the path. procedure ListFiles(AccountId: Guid; Path: Text; FilePaginationData: Codeunit "File Pagination Data"; var TempFileAccountContent: Record "File Account Content" temporary) var - ABSContainerContent: Record "ABS Container Content"; + TempABSContainerContent: Record "ABS Container Content"; ABSBlobClient: Codeunit "ABS Blob Client"; ABSOperationResponse: Codeunit "ABS Operation Response"; ABSOptionalParameters: Codeunit "ABS Optional Parameters"; @@ -40,21 +40,21 @@ codeunit 4560 "Ext. Blob Sto. Connector Impl." implements "External File Storage CheckPath(Path); InitOptionalParameters(Path, FilePaginationData, ABSOptionalParameters); ABSOptionalParameters.Delimiter('/'); - ABSOperationResponse := ABSBlobClient.ListBlobs(ABSContainerContent, ABSOptionalParameters); + ABSOperationResponse := ABSBlobClient.ListBlobs(TempABSContainerContent, ABSOptionalParameters); ValidateListingResponse(FilePaginationData, ABSOperationResponse); - ABSContainerContent.SetFilter("Blob Type", '<>%1', ''); - ABSContainerContent.SetFilter(Name, '<>%1', MarkerFileNameTok); - if not ABSContainerContent.FindSet() then + TempABSContainerContent.SetFilter("Blob Type", '<>%1', ''); + TempABSContainerContent.SetFilter(Name, '<>%1', MarkerFileNameTok); + if not TempABSContainerContent.FindSet() then exit; repeat TempFileAccountContent.Init(); - TempFileAccountContent.Name := ABSContainerContent.Name; + TempFileAccountContent.Name := TempABSContainerContent.Name; TempFileAccountContent.Type := TempFileAccountContent.Type::"File"; - TempFileAccountContent."Parent Directory" := ABSContainerContent."Parent Directory"; + TempFileAccountContent."Parent Directory" := TempABSContainerContent."Parent Directory"; TempFileAccountContent.Insert(); - until ABSContainerContent.Next() = 0; + until TempABSContainerContent.Next() = 0; end; /// @@ -144,7 +144,7 @@ codeunit 4560 "Ext. Blob Sto. Connector Impl." implements "External File Storage /// Returns true if the file exists procedure FileExists(AccountId: Guid; Path: Text): Boolean var - ABSContainerContent: Record "ABS Container Content"; + TempABSContainerContent: Record "ABS Container Content"; ABSBlobClient: Codeunit "ABS Blob Client"; ABSOperationResponse: Codeunit "ABS Operation Response"; ABSOptionalParameters: Codeunit "ABS Optional Parameters"; @@ -154,11 +154,11 @@ codeunit 4560 "Ext. Blob Sto. Connector Impl." implements "External File Storage InitBlobClient(AccountId, ABSBlobClient); ABSOptionalParameters.Prefix(Path); - ABSOperationResponse := ABSBlobClient.ListBlobs(ABSContainerContent, ABSOptionalParameters); + ABSOperationResponse := ABSBlobClient.ListBlobs(TempABSContainerContent, ABSOptionalParameters); if not ABSOperationResponse.IsSuccessful() then Error(ABSOperationResponse.GetError()); - exit(not ABSContainerContent.IsEmpty()); + exit(not TempABSContainerContent.IsEmpty()); end; /// @@ -189,7 +189,7 @@ codeunit 4560 "Ext. Blob Sto. Connector Impl." implements "External File Storage /// A list with all directories stored in the path. procedure ListDirectories(AccountId: Guid; Path: Text; FilePaginationData: Codeunit "File Pagination Data"; var TempFileAccountContent: Record "File Account Content" temporary) var - ABSContainerContent: Record "ABS Container Content"; + TempABSContainerContent: Record "ABS Container Content"; ABSBlobClient: Codeunit "ABS Blob Client"; ABSOperationResponse: Codeunit "ABS Operation Response"; ABSOptionalParameters: Codeunit "ABS Optional Parameters"; @@ -197,21 +197,21 @@ codeunit 4560 "Ext. Blob Sto. Connector Impl." implements "External File Storage InitBlobClient(AccountId, ABSBlobClient); CheckPath(Path); InitOptionalParameters(Path, FilePaginationData, ABSOptionalParameters); - ABSOperationResponse := ABSBlobClient.ListBlobs(ABSContainerContent, ABSOptionalParameters); + ABSOperationResponse := ABSBlobClient.ListBlobs(TempABSContainerContent, ABSOptionalParameters); ValidateListingResponse(FilePaginationData, ABSOperationResponse); - ABSContainerContent.SetRange("Parent Directory", Path); - ABSContainerContent.SetRange("Resource Type", ABSContainerContent."Resource Type"::Directory); - if not ABSContainerContent.FindSet() then + TempABSContainerContent.SetRange("Parent Directory", Path); + TempABSContainerContent.SetRange("Resource Type", TempABSContainerContent."Resource Type"::Directory); + if not TempABSContainerContent.FindSet() then exit; repeat TempFileAccountContent.Init(); - TempFileAccountContent.Name := ABSContainerContent.Name; + TempFileAccountContent.Name := TempABSContainerContent.Name; TempFileAccountContent.Type := TempFileAccountContent.Type::Directory; - TempFileAccountContent."Parent Directory" := ABSContainerContent."Parent Directory"; + TempFileAccountContent."Parent Directory" := TempABSContainerContent."Parent Directory"; TempFileAccountContent.Insert(); - until ABSContainerContent.Next() = 0; + until TempABSContainerContent.Next() = 0; end; /// @@ -246,7 +246,7 @@ codeunit 4560 "Ext. Blob Sto. Connector Impl." implements "External File Storage /// Returns true if the directory exists procedure DirectoryExists(AccountId: Guid; Path: Text): Boolean var - ABSContainerContent: Record "ABS Container Content"; + TempABSContainerContent: Record "ABS Container Content"; ABSBlobClient: Codeunit "ABS Blob Client"; ABSOperationResponse: Codeunit "ABS Operation Response"; ABSOptionalParameters: Codeunit "ABS Optional Parameters"; @@ -257,11 +257,11 @@ codeunit 4560 "Ext. Blob Sto. Connector Impl." implements "External File Storage InitBlobClient(AccountId, ABSBlobClient); ABSOptionalParameters.Prefix(Path); ABSOptionalParameters.MaxResults(1); - ABSOperationResponse := ABSBlobClient.ListBlobs(ABSContainerContent, ABSOptionalParameters); + ABSOperationResponse := ABSBlobClient.ListBlobs(TempABSContainerContent, ABSOptionalParameters); if not ABSOperationResponse.IsSuccessful() then Error(ABSOperationResponse.GetError()); - exit(not ABSContainerContent.IsEmpty()); + exit(not TempABSContainerContent.IsEmpty()); end; /// @@ -401,7 +401,7 @@ codeunit 4560 "Ext. Blob Sto. Connector Impl." implements "External File Storage internal procedure LookUpContainer(var Account: Record "Ext. Blob Storage Account"; AuthType: Enum "Ext. Blob Storage Auth. Type"; Secret: SecretText; var NewContainerName: Text[2048]) var - ABSContainers: Record "ABS Container"; + TempABSContainers: Record "ABS Container"; ABSContainerClient: Codeunit "ABS Container Client"; StorageServiceAuthorization: Codeunit "Storage Service Authorization"; ABSOperationResponse: Codeunit "ABS Operation Response"; @@ -416,17 +416,17 @@ codeunit 4560 "Ext. Blob Sto. Connector Impl." implements "External File Storage end; ABSContainerClient.Initialize(Account."Storage Account Name", Authorization); - ABSOperationResponse := ABSContainerClient.ListContainers(ABSContainers); + ABSOperationResponse := ABSContainerClient.ListContainers(TempABSContainers); if not ABSOperationResponse.IsSuccessful() then Error(ABSOperationResponse.GetError()); - if not ABSContainers.Get(NewContainerName) then - if ABSContainers.FindFirst() then; + if not TempABSContainers.Get(NewContainerName) then + if TempABSContainers.FindFirst() then; - if (Page.RunModal(Page::"Ext. Blob Sto Container Lookup", ABSContainers) <> Action::LookupOK) then + if (Page.RunModal(Page::"Ext. Blob Sto Container Lookup", TempABSContainers) <> Action::LookupOK) then exit; - NewContainerName := ABSContainers.Name; + NewContainerName := TempABSContainers.Name; end; local procedure InitBlobClient(var AccountId: Guid; var ABSBlobClient: Codeunit "ABS Blob Client") diff --git a/src/Apps/W1/External File Storage - Azure Blob Service Connector/App/src/ExtBlobStorAccountWizard.Page.al b/src/Apps/W1/External File Storage - Azure Blob Service Connector/App/src/ExtBlobStorAccountWizard.Page.al index 22bd90a085..da99a49bbd 100644 --- a/src/Apps/W1/External File Storage - Azure Blob Service Connector/App/src/ExtBlobStorAccountWizard.Page.al +++ b/src/Apps/W1/External File Storage - Azure Blob Service Connector/App/src/ExtBlobStorAccountWizard.Page.al @@ -127,7 +127,7 @@ page 4561 "Ext. Blob Stor. Account Wizard" trigger OnAction() begin - BlobStorageConnectorImpl.CreateAccount(Rec, Secret, BlobStorageAccount); + BlobStorageConnectorImpl.CreateAccount(Rec, Secret, TempBlobStorageAccount); CurrPage.Close(); end; } @@ -135,7 +135,7 @@ page 4561 "Ext. Blob Stor. Account Wizard" } var - BlobStorageAccount: Record "File Account"; + TempBlobStorageAccount: Record "File Account"; MediaResources: Record "Media Resources"; BlobStorageConnectorImpl: Codeunit "Ext. Blob Sto. Connector Impl."; [NonDebuggable] @@ -156,10 +156,10 @@ page 4561 "Ext. Blob Stor. Account Wizard" internal procedure GetAccount(var FileAccount: Record "File Account"): Boolean begin - if IsNullGuid(BlobStorageAccount."Account Id") then + if IsNullGuid(TempBlobStorageAccount."Account Id") then exit(false); - FileAccount := BlobStorageAccount; + FileAccount := TempBlobStorageAccount; exit(true); end; diff --git a/src/Apps/W1/External File Storage - Azure Blob Service Connector/Test/src/ExtAzureBlobServiceTest.Codeunit.al b/src/Apps/W1/External File Storage - Azure Blob Service Connector/Test/src/ExtAzureBlobServiceTest.Codeunit.al index c5a88c0bd8..8d0ce5ae90 100644 --- a/src/Apps/W1/External File Storage - Azure Blob Service Connector/Test/src/ExtAzureBlobServiceTest.Codeunit.al +++ b/src/Apps/W1/External File Storage - Azure Blob Service Connector/Test/src/ExtAzureBlobServiceTest.Codeunit.al @@ -20,7 +20,7 @@ codeunit 144566 "Ext. Azure Blob Service Test" [TransactionModel(TransactionModel::AutoRollback)] procedure TestMultipleAccountsCanBeRegistered() var - FileAccount: Record "File Account"; + TempFileAccount: Record "File Account"; ExtFileConnector: Codeunit "Ext. Blob Sto. Connector Impl."; FileAccounts: TestPage "File Accounts"; AccountIds: array[3] of Guid; @@ -34,14 +34,14 @@ codeunit 144566 "Ext. Azure Blob Service Test" for Index := 1 to 3 do begin SetBasicAccount(); - Assert.IsTrue(ExtFileConnector.RegisterAccount(FileAccount), 'Failed to register account.'); - AccountIds[Index] := FileAccount."Account Id"; + Assert.IsTrue(ExtFileConnector.RegisterAccount(TempFileAccount), 'Failed to register account.'); + AccountIds[Index] := TempFileAccount."Account Id"; AccountName[Index] := FileAccountMock.Name(); // [Then] Accounts are retrieved from the GetAccounts method - FileAccount.DeleteAll(); - ExtFileConnector.GetAccounts(FileAccount); - Assert.RecordCount(FileAccount, Index); + TempFileAccount.DeleteAll(); + ExtFileConnector.GetAccounts(TempFileAccount); + Assert.RecordCount(TempFileAccount, Index); end; FileAccounts.OpenView(); @@ -58,7 +58,7 @@ codeunit 144566 "Ext. Azure Blob Service Test" [TransactionModel(TransactionModel::AutoRollback)] procedure TestEnviromentCleanupDisablesAccounts() var - FileAccount: Record "File Account"; + TempFileAccount: Record "File Account"; ExtSharePointAccount: Record "Ext. Blob Storage Account"; ExtFileConnector: Codeunit "Ext. Blob Sto. Connector Impl."; EnvironmentTriggers: Codeunit "Environment Triggers"; @@ -72,13 +72,13 @@ codeunit 144566 "Ext. Azure Blob Service Test" for Index := 1 to 3 do begin SetBasicAccount(); - Assert.IsTrue(ExtFileConnector.RegisterAccount(FileAccount), 'Failed to register account.'); - AccountIds[Index] := FileAccount."Account Id"; + Assert.IsTrue(ExtFileConnector.RegisterAccount(TempFileAccount), 'Failed to register account.'); + AccountIds[Index] := TempFileAccount."Account Id"; // [Then] Accounts are retrieved from the GetAccounts method - FileAccount.DeleteAll(); - ExtFileConnector.GetAccounts(FileAccount); - Assert.RecordCount(FileAccount, Index); + TempFileAccount.DeleteAll(); + ExtFileConnector.GetAccounts(TempFileAccount); + Assert.RecordCount(TempFileAccount, Index); end; ExtSharePointAccount.SetRange(Disabled, true); @@ -95,7 +95,7 @@ codeunit 144566 "Ext. Azure Blob Service Test" [TransactionModel(TransactionModel::AutoRollback)] procedure TestShowAccountInformation() var - FileAccount: Record "File Account"; + TempFileAccount: Record "File Account"; FileConnector: Codeunit "Ext. Blob Sto. Connector Impl."; begin // [Scenario] Account Information is displayed in the Account page. @@ -103,10 +103,10 @@ codeunit 144566 "Ext. Azure Blob Service Test" // [Given] An file account Initialize(); SetBasicAccount(); - FileConnector.RegisterAccount(FileAccount); + FileConnector.RegisterAccount(TempFileAccount); // [When] The ShowAccountInformation method is invoked - FileConnector.ShowAccountInformation(FileAccount."Account Id"); + FileConnector.ShowAccountInformation(TempFileAccount."Account Id"); // [Then] The account page opens and displays the information // Verify in AccountModalPageHandler diff --git a/src/Apps/W1/External File Storage - Azure File Service Connector/App/src/ExtFileShareAccountWizard.Page.al b/src/Apps/W1/External File Storage - Azure File Service Connector/App/src/ExtFileShareAccountWizard.Page.al index a1d85ab5d3..c98169818c 100644 --- a/src/Apps/W1/External File Storage - Azure File Service Connector/App/src/ExtFileShareAccountWizard.Page.al +++ b/src/Apps/W1/External File Storage - Azure File Service Connector/App/src/ExtFileShareAccountWizard.Page.al @@ -115,7 +115,7 @@ page 4571 "Ext. File Share Account Wizard" trigger OnAction() begin - FileShareConnectorImpl.CreateAccount(Rec, Secret, FileShareAccount); + FileShareConnectorImpl.CreateAccount(Rec, Secret, TempFileShareAccount); CurrPage.Close(); end; } @@ -123,7 +123,7 @@ page 4571 "Ext. File Share Account Wizard" } var - FileShareAccount: Record "File Account"; + TempFileShareAccount: Record "File Account"; MediaResources: Record "Media Resources"; FileShareConnectorImpl: Codeunit "Ext. File Share Connector Impl"; [NonDebuggable] @@ -144,10 +144,10 @@ page 4571 "Ext. File Share Account Wizard" internal procedure GetAccount(var FileAccount: Record "File Account"): Boolean begin - if IsNullGuid(FileShareAccount."Account Id") then + if IsNullGuid(TempFileShareAccount."Account Id") then exit(false); - FileAccount := FileShareAccount; + FileAccount := TempFileShareAccount; exit(true); end; diff --git a/src/Apps/W1/External File Storage - Azure File Service Connector/App/src/ExtFileShareConnectorImpl.Codeunit.al b/src/Apps/W1/External File Storage - Azure File Service Connector/App/src/ExtFileShareConnectorImpl.Codeunit.al index bfb759c612..c11aa117ad 100644 --- a/src/Apps/W1/External File Storage - Azure File Service Connector/App/src/ExtFileShareConnectorImpl.Codeunit.al +++ b/src/Apps/W1/External File Storage - Azure File Service Connector/App/src/ExtFileShareConnectorImpl.Codeunit.al @@ -32,22 +32,22 @@ codeunit 4570 "Ext. File Share Connector Impl" implements "External File Storage /// A list with all files stored in the path. procedure ListFiles(AccountId: Guid; Path: Text; FilePaginationData: Codeunit "File Pagination Data"; var TempFileAccountContent: Record "File Account Content" temporary) var - AFSDirectoryContent: Record "AFS Directory Content"; + TempAFSDirectoryContent: Record "AFS Directory Content"; begin - GetDirectoryContent(AccountId, Path, FilePaginationData, AFSDirectoryContent); + GetDirectoryContent(AccountId, Path, FilePaginationData, TempAFSDirectoryContent); - AFSDirectoryContent.SetRange("Parent Directory", Path); - AFSDirectoryContent.SetRange("Resource Type", AFSDirectoryContent."Resource Type"::File); - if not AFSDirectoryContent.FindSet() then + TempAFSDirectoryContent.SetRange("Parent Directory", Path); + TempAFSDirectoryContent.SetRange("Resource Type", TempAFSDirectoryContent."Resource Type"::File); + if not TempAFSDirectoryContent.FindSet() then exit; repeat TempFileAccountContent.Init(); - TempFileAccountContent.Name := AFSDirectoryContent.Name; + TempFileAccountContent.Name := TempAFSDirectoryContent.Name; TempFileAccountContent.Type := TempFileAccountContent.Type::"File"; - TempFileAccountContent."Parent Directory" := AFSDirectoryContent."Parent Directory"; + TempFileAccountContent."Parent Directory" := TempAFSDirectoryContent."Parent Directory"; TempFileAccountContent.Insert(); - until AFSDirectoryContent.Next() = 0; + until TempAFSDirectoryContent.Next() = 0; end; /// @@ -180,22 +180,22 @@ codeunit 4570 "Ext. File Share Connector Impl" implements "External File Storage /// A list with all directories stored in the path. procedure ListDirectories(AccountId: Guid; Path: Text; FilePaginationData: Codeunit "File Pagination Data"; var TempFileAccountContent: Record "File Account Content" temporary) var - AFSDirectoryContent: Record "AFS Directory Content"; + TempAFSDirectoryContent: Record "AFS Directory Content"; begin - GetDirectoryContent(AccountId, Path, FilePaginationData, AFSDirectoryContent); + GetDirectoryContent(AccountId, Path, FilePaginationData, TempAFSDirectoryContent); - AFSDirectoryContent.SetRange("Parent Directory", Path); - AFSDirectoryContent.SetRange("Resource Type", AFSDirectoryContent."Resource Type"::Directory); - if not AFSDirectoryContent.FindSet() then + TempAFSDirectoryContent.SetRange("Parent Directory", Path); + TempAFSDirectoryContent.SetRange("Resource Type", TempAFSDirectoryContent."Resource Type"::Directory); + if not TempAFSDirectoryContent.FindSet() then exit; repeat TempFileAccountContent.Init(); - TempFileAccountContent.Name := AFSDirectoryContent.Name; + TempFileAccountContent.Name := TempAFSDirectoryContent.Name; TempFileAccountContent.Type := TempFileAccountContent.Type::Directory; - TempFileAccountContent."Parent Directory" := AFSDirectoryContent."Parent Directory"; + TempFileAccountContent."Parent Directory" := TempAFSDirectoryContent."Parent Directory"; TempFileAccountContent.Insert(); - until AFSDirectoryContent.Next() = 0; + until TempAFSDirectoryContent.Next() = 0; end; /// @@ -226,7 +226,7 @@ codeunit 4570 "Ext. File Share Connector Impl" implements "External File Storage /// Returns true if the directory exists procedure DirectoryExists(AccountId: Guid; Path: Text): Boolean var - AFSDirectoryContent: Record "AFS Directory Content"; + TempAFSDirectoryContent: Record "AFS Directory Content"; AFSFileClient: Codeunit "AFS File Client"; AFSOperationResponse: Codeunit "AFS Operation Response"; AFSOptionalParameters: Codeunit "AFS Optional Parameters"; @@ -236,7 +236,7 @@ codeunit 4570 "Ext. File Share Connector Impl" implements "External File Storage InitFileClient(AccountId, AFSFileClient); AFSOptionalParameters.MaxResults(1); - AFSOperationResponse := AFSFileClient.ListDirectory(CopyStr(Path, 1, 2048), AFSDirectoryContent, AFSOptionalParameters); + AFSOperationResponse := AFSFileClient.ListDirectory(CopyStr(Path, 1, 2048), TempAFSDirectoryContent, AFSOptionalParameters); if AFSOperationResponse.IsSuccessful() then exit(true); @@ -416,19 +416,19 @@ codeunit 4570 "Ext. File Share Connector Impl" implements "External File Storage AFSOptionalParameters.Marker(FilePaginationData.GetMarker()); end; - local procedure ValidateListingResponse(var FilePaginationData: Codeunit "File Pagination Data"; var AFSDirectoryContent: Record "AFS Directory Content"; var AFSOperationResponse: Codeunit "AFS Operation Response") + local procedure ValidateListingResponse(var FilePaginationData: Codeunit "File Pagination Data"; var TempAFSDirectoryContent: Record "AFS Directory Content"; var AFSOperationResponse: Codeunit "AFS Operation Response") begin if not AFSOperationResponse.IsSuccessful() then Error(AFSOperationResponse.GetError()); - if not AFSDirectoryContent.FindLast() then + if not TempAFSDirectoryContent.FindLast() then FilePaginationData.SetEndOfListing(true); - FilePaginationData.SetMarker(AFSDirectoryContent."Next Marker"); - FilePaginationData.SetEndOfListing(AFSDirectoryContent."Next Marker" = ''); + FilePaginationData.SetMarker(TempAFSDirectoryContent."Next Marker"); + FilePaginationData.SetEndOfListing(TempAFSDirectoryContent."Next Marker" = ''); end; - local procedure GetDirectoryContent(var AccountId: Guid; var PassedPath: Text; var FilePaginationData: Codeunit "File Pagination Data"; var AFSDirectoryContent: Record "AFS Directory Content") + local procedure GetDirectoryContent(var AccountId: Guid; var PassedPath: Text; var FilePaginationData: Codeunit "File Pagination Data"; var TempAFSDirectoryContent: Record "AFS Directory Content") var AFSFileClient: Codeunit "AFS File Client"; AFSOperationResponse: Codeunit "AFS Operation Response"; @@ -439,9 +439,9 @@ codeunit 4570 "Ext. File Share Connector Impl" implements "External File Storage CheckPath(PassedPath); InitOptionalParameters(FilePaginationData, AFSOptionalParameters); Path := CopyStr(PassedPath, 1, MaxStrLen(Path)); - AFSOperationResponse := AFSFileClient.ListDirectory(Path, AFSDirectoryContent, AFSOptionalParameters); + AFSOperationResponse := AFSFileClient.ListDirectory(Path, TempAFSDirectoryContent, AFSOptionalParameters); PassedPath := Path; - ValidateListingResponse(FilePaginationData, AFSDirectoryContent, AFSOperationResponse); + ValidateListingResponse(FilePaginationData, TempAFSDirectoryContent, AFSOperationResponse); end; local procedure SetReadySAS(var StorageServiceAuthorization: Codeunit "Storage Service Authorization"; Secret: SecretText): Interface System.Azure.Storage."Storage Service Authorization" diff --git a/src/Apps/W1/External File Storage - Azure File Service Connector/Test/src/ExtAzureFileServiceTest.Codeunit.al b/src/Apps/W1/External File Storage - Azure File Service Connector/Test/src/ExtAzureFileServiceTest.Codeunit.al index 54903ac7b3..b2584b578d 100644 --- a/src/Apps/W1/External File Storage - Azure File Service Connector/Test/src/ExtAzureFileServiceTest.Codeunit.al +++ b/src/Apps/W1/External File Storage - Azure File Service Connector/Test/src/ExtAzureFileServiceTest.Codeunit.al @@ -20,7 +20,7 @@ codeunit 144571 "Ext. Azure File Service Test" [TransactionModel(TransactionModel::AutoRollback)] procedure TestMultipleAccountsCanBeRegistered() var - FileAccount: Record "File Account"; + TempFileAccount: Record "File Account"; ExtFileConnector: Codeunit "Ext. File Share Connector Impl"; FileAccounts: TestPage "File Accounts"; AccountIds: array[3] of Guid; @@ -34,14 +34,14 @@ codeunit 144571 "Ext. Azure File Service Test" for Index := 1 to 3 do begin SetBasicAccount(); - Assert.IsTrue(ExtFileConnector.RegisterAccount(FileAccount), 'Failed to register account.'); - AccountIds[Index] := FileAccount."Account Id"; + Assert.IsTrue(ExtFileConnector.RegisterAccount(TempFileAccount), 'Failed to register account.'); + AccountIds[Index] := TempFileAccount."Account Id"; AccountName[Index] := FileAccountMock.Name(); // [Then] Accounts are retrieved from the GetAccounts method - FileAccount.DeleteAll(); - ExtFileConnector.GetAccounts(FileAccount); - Assert.RecordCount(FileAccount, Index); + TempFileAccount.DeleteAll(); + ExtFileConnector.GetAccounts(TempFileAccount); + Assert.RecordCount(TempFileAccount, Index); end; FileAccounts.OpenView(); @@ -58,7 +58,7 @@ codeunit 144571 "Ext. Azure File Service Test" [TransactionModel(TransactionModel::AutoRollback)] procedure TestEnviromentCleanupDisablesAccounts() var - FileAccount: Record "File Account"; + TempFileAccount: Record "File Account"; ExtSharePointAccount: Record "Ext. File Share Account"; ExtFileConnector: Codeunit "Ext. File Share Connector Impl"; EnvironmentTriggers: Codeunit "Environment Triggers"; @@ -72,13 +72,13 @@ codeunit 144571 "Ext. Azure File Service Test" for Index := 1 to 3 do begin SetBasicAccount(); - Assert.IsTrue(ExtFileConnector.RegisterAccount(FileAccount), 'Failed to register account.'); - AccountIds[Index] := FileAccount."Account Id"; + Assert.IsTrue(ExtFileConnector.RegisterAccount(TempFileAccount), 'Failed to register account.'); + AccountIds[Index] := TempFileAccount."Account Id"; // [Then] Accounts are retrieved from the GetAccounts method - FileAccount.DeleteAll(); - ExtFileConnector.GetAccounts(FileAccount); - Assert.RecordCount(FileAccount, Index); + TempFileAccount.DeleteAll(); + ExtFileConnector.GetAccounts(TempFileAccount); + Assert.RecordCount(TempFileAccount, Index); end; ExtSharePointAccount.SetRange(Disabled, true); @@ -95,7 +95,7 @@ codeunit 144571 "Ext. Azure File Service Test" [TransactionModel(TransactionModel::AutoRollback)] procedure TestShowAccountInformation() var - FileAccount: Record "File Account"; + TempFileAccount: Record "File Account"; FileConnector: Codeunit "Ext. File Share Connector Impl"; begin // [Scenario] Account Information is displayed in the Account page. @@ -103,10 +103,10 @@ codeunit 144571 "Ext. Azure File Service Test" // [Given] An file account Initialize(); SetBasicAccount(); - FileConnector.RegisterAccount(FileAccount); + FileConnector.RegisterAccount(TempFileAccount); // [When] The ShowAccountInformation method is invoked - FileConnector.ShowAccountInformation(FileAccount."Account Id"); + FileConnector.ShowAccountInformation(TempFileAccount."Account Id"); // [Then] The account page opens and displays the information // Verify in AccountModalPageHandler diff --git a/src/Apps/W1/External File Storage - SFTP Connector/App/src/ExtSFTPAccountWizard.Page.al b/src/Apps/W1/External File Storage - SFTP Connector/App/src/ExtSFTPAccountWizard.Page.al index 74696cdb3e..a8da971cb9 100644 --- a/src/Apps/W1/External File Storage - SFTP Connector/App/src/ExtSFTPAccountWizard.Page.al +++ b/src/Apps/W1/External File Storage - SFTP Connector/App/src/ExtSFTPAccountWizard.Page.al @@ -179,7 +179,7 @@ page 4622 "Ext. SFTP Account Wizard" trigger OnAction() begin - ConnectorImpl.CreateAccount(Rec, Password, Certificate, CertificatePassword, Account); + ConnectorImpl.CreateAccount(Rec, Password, Certificate, CertificatePassword, TempAccount); CurrPage.Close(); end; } @@ -187,7 +187,7 @@ page 4622 "Ext. SFTP Account Wizard" } var - Account: Record "File Account"; + TempAccount: Record "File Account"; MediaResources: Record "Media Resources"; ConnectorImpl: Codeunit "Ext. SFTP Connector Impl"; [NonDebuggable] @@ -213,10 +213,10 @@ page 4622 "Ext. SFTP Account Wizard" internal procedure GetAccount(var FileAccount: Record "File Account"): Boolean begin - if IsNullGuid(Account."Account Id") then + if IsNullGuid(TempAccount."Account Id") then exit(false); - FileAccount := Account; + FileAccount := TempAccount; exit(true); end; diff --git a/src/Apps/W1/External File Storage - SFTP Connector/App/src/ExtSFTPConnectorImpl.Codeunit.al b/src/Apps/W1/External File Storage - SFTP Connector/App/src/ExtSFTPConnectorImpl.Codeunit.al index 473feb955b..7667621f7c 100644 --- a/src/Apps/W1/External File Storage - SFTP Connector/App/src/ExtSFTPConnectorImpl.Codeunit.al +++ b/src/Apps/W1/External File Storage - SFTP Connector/App/src/ExtSFTPConnectorImpl.Codeunit.al @@ -31,7 +31,7 @@ codeunit 4621 "Ext. SFTP Connector Impl" implements "External File Storage Conne /// A list with all files stored in the path. procedure ListFiles(AccountId: Guid; Path: Text; FilePaginationData: Codeunit "File Pagination Data"; var TempFileAccountContent: Record "File Account Content" temporary) var - FolderContent: Record "SFTP Folder Content"; + TempFolderContent: Record "SFTP Folder Content"; SFTPClient: Codeunit "SFTP Client"; Response: Codeunit "SFTP Operation Response"; OrginalPath: Text; @@ -39,7 +39,7 @@ codeunit 4621 "Ext. SFTP Connector Impl" implements "External File Storage Conne OrginalPath := Path; InitPath(AccountId, Path); InitSFTPClient(AccountId, SFTPClient); - Response := SFTPClient.ListFiles(Path, FolderContent); + Response := SFTPClient.ListFiles(Path, TempFolderContent); SFTPClient.Disconnect(); if Response.IsError() then @@ -47,17 +47,17 @@ codeunit 4621 "Ext. SFTP Connector Impl" implements "External File Storage Conne FilePaginationData.SetEndOfListing(true); - FolderContent.SetRange("Is Directory", false); - if not FolderContent.FindSet() then + TempFolderContent.SetRange("Is Directory", false); + if not TempFolderContent.FindSet() then exit; repeat TempFileAccountContent.Init(); - TempFileAccountContent.Name := FolderContent.Name; + TempFileAccountContent.Name := TempFolderContent.Name; TempFileAccountContent.Type := TempFileAccountContent.Type::"File"; TempFileAccountContent."Parent Directory" := CopyStr(OrginalPath, 1, MaxStrLen(TempFileAccountContent."Parent Directory")); TempFileAccountContent.Insert(); - until FolderContent.Next() = 0; + until TempFolderContent.Next() = 0; end; /// @@ -197,7 +197,7 @@ codeunit 4621 "Ext. SFTP Connector Impl" implements "External File Storage Conne /// A list with all directories stored in the path. procedure ListDirectories(AccountId: Guid; Path: Text; FilePaginationData: Codeunit "File Pagination Data"; var TempFileAccountContent: Record "File Account Content" temporary) var - FolderContent: Record "SFTP Folder Content"; + TempFolderContent: Record "SFTP Folder Content"; SFTPClient: Codeunit "SFTP Client"; Response: Codeunit "SFTP Operation Response"; OrginalPath: Text; @@ -205,7 +205,7 @@ codeunit 4621 "Ext. SFTP Connector Impl" implements "External File Storage Conne OrginalPath := Path; InitPath(AccountId, Path); InitSFTPClient(AccountId, SFTPClient); - Response := SFTPClient.ListFiles(Path, FolderContent); + Response := SFTPClient.ListFiles(Path, TempFolderContent); SFTPClient.Disconnect(); if Response.IsError() then @@ -213,18 +213,18 @@ codeunit 4621 "Ext. SFTP Connector Impl" implements "External File Storage Conne FilePaginationData.SetEndOfListing(true); - FolderContent.SetRange("Is Directory", true); - FolderContent.SetFilter(Name, '<>%1&<>%2', '.', '..'); // Exclude . and .. - if not FolderContent.FindSet() then + TempFolderContent.SetRange("Is Directory", true); + TempFolderContent.SetFilter(Name, '<>%1&<>%2', '.', '..'); // Exclude . and .. + if not TempFolderContent.FindSet() then exit; repeat TempFileAccountContent.Init(); - TempFileAccountContent.Name := FolderContent.Name; + TempFileAccountContent.Name := TempFolderContent.Name; TempFileAccountContent.Type := TempFileAccountContent.Type::Directory; TempFileAccountContent."Parent Directory" := CopyStr(OrginalPath, 1, MaxStrLen(TempFileAccountContent."Parent Directory")); TempFileAccountContent.Insert(); - until FolderContent.Next() = 0; + until TempFolderContent.Next() = 0; end; /// diff --git a/src/Apps/W1/External File Storage - SFTP Connector/Test/src/ExtSFTPConnectorTest.Codeunit.al b/src/Apps/W1/External File Storage - SFTP Connector/Test/src/ExtSFTPConnectorTest.Codeunit.al index 7241327e0f..0ff3dedcc5 100644 --- a/src/Apps/W1/External File Storage - SFTP Connector/Test/src/ExtSFTPConnectorTest.Codeunit.al +++ b/src/Apps/W1/External File Storage - SFTP Connector/Test/src/ExtSFTPConnectorTest.Codeunit.al @@ -20,7 +20,7 @@ codeunit 144591 "Ext. SFTP Connector Test" [TransactionModel(TransactionModel::AutoRollback)] procedure TestMultipleAccountsCanBeRegistered() var - FileAccount: Record "File Account"; + TempFileAccount: Record "File Account"; ExtFileConnector: Codeunit "Ext. SFTP Connector Impl"; FileAccounts: TestPage "File Accounts"; AccountIds: array[3] of Guid; @@ -34,14 +34,14 @@ codeunit 144591 "Ext. SFTP Connector Test" for Index := 1 to 3 do begin SetBasicAccount(); - Assert.IsTrue(ExtFileConnector.RegisterAccount(FileAccount), 'Failed to register account.'); - AccountIds[Index] := FileAccount."Account Id"; + Assert.IsTrue(ExtFileConnector.RegisterAccount(TempFileAccount), 'Failed to register account.'); + AccountIds[Index] := TempFileAccount."Account Id"; AccountName[Index] := FileAccountMock.Name(); // [Then] Accounts are retrieved from the GetAccounts method - FileAccount.DeleteAll(); - ExtFileConnector.GetAccounts(FileAccount); - Assert.RecordCount(FileAccount, Index); + TempFileAccount.DeleteAll(); + ExtFileConnector.GetAccounts(TempFileAccount); + Assert.RecordCount(TempFileAccount, Index); end; FileAccounts.OpenView(); @@ -57,7 +57,7 @@ codeunit 144591 "Ext. SFTP Connector Test" [TransactionModel(TransactionModel::AutoRollback)] procedure TestEnvironmentCleanupDisablesAccounts() var - FileAccount: Record "File Account"; + TempFileAccount: Record "File Account"; ExtSFTPAccount: Record "Ext. SFTP Account"; ExtFileConnector: Codeunit "Ext. SFTP Connector Impl"; EnvironmentTriggers: Codeunit "Environment Triggers"; @@ -71,13 +71,13 @@ codeunit 144591 "Ext. SFTP Connector Test" for Index := 1 to 3 do begin SetBasicAccount(); - Assert.IsTrue(ExtFileConnector.RegisterAccount(FileAccount), 'Failed to register account.'); - AccountIds[Index] := FileAccount."Account Id"; + Assert.IsTrue(ExtFileConnector.RegisterAccount(TempFileAccount), 'Failed to register account.'); + AccountIds[Index] := TempFileAccount."Account Id"; // [Then] Accounts are retrieved from the GetAccounts method - FileAccount.DeleteAll(); - ExtFileConnector.GetAccounts(FileAccount); - Assert.RecordCount(FileAccount, Index); + TempFileAccount.DeleteAll(); + ExtFileConnector.GetAccounts(TempFileAccount); + Assert.RecordCount(TempFileAccount, Index); end; ExtSFTPAccount.SetRange(Disabled, true); @@ -94,7 +94,7 @@ codeunit 144591 "Ext. SFTP Connector Test" [TransactionModel(TransactionModel::AutoRollback)] procedure TestShowAccountInformation() var - FileAccount: Record "File Account"; + TempFileAccount: Record "File Account"; FileConnector: Codeunit "Ext. SFTP Connector Impl"; begin // [Scenario] Account Information is displayed in the Account page. @@ -102,10 +102,10 @@ codeunit 144591 "Ext. SFTP Connector Test" // [Given] An file account Initialize(); SetBasicAccount(); - FileConnector.RegisterAccount(FileAccount); + FileConnector.RegisterAccount(TempFileAccount); // [When] The ShowAccountInformation method is invoked - FileConnector.ShowAccountInformation(FileAccount."Account Id"); + FileConnector.ShowAccountInformation(TempFileAccount."Account Id"); // [Then] The account page opens and displays the information // Verify in AccountModalPageHandler diff --git a/src/Apps/W1/External File Storage - SharePoint Connector/App/src/ExtSharePointAccountWizard.Page.al b/src/Apps/W1/External File Storage - SharePoint Connector/App/src/ExtSharePointAccountWizard.Page.al index 10fef6fb73..29fea7fe10 100644 --- a/src/Apps/W1/External File Storage - SharePoint Connector/App/src/ExtSharePointAccountWizard.Page.al +++ b/src/Apps/W1/External File Storage - SharePoint Connector/App/src/ExtSharePointAccountWizard.Page.al @@ -182,7 +182,7 @@ page 4581 "Ext. SharePoint Account Wizard" SecretToPass := Certificate; end; - SharePointConnectorImpl.CreateAccount(Rec, SecretToPass, CertificatePassword, SharePointAccount); + SharePointConnectorImpl.CreateAccount(Rec, SecretToPass, CertificatePassword, TempSharePointAccount); CurrPage.Close(); end; } @@ -190,7 +190,7 @@ page 4581 "Ext. SharePoint Account Wizard" } var - SharePointAccount: Record "File Account"; + TempSharePointAccount: Record "File Account"; MediaResources: Record "Media Resources"; SharePointConnectorImpl: Codeunit "Ext. SharePoint Connector Impl"; [NonDebuggable] @@ -220,10 +220,10 @@ page 4581 "Ext. SharePoint Account Wizard" internal procedure GetAccount(var FileAccount: Record "File Account"): Boolean begin - if IsNullGuid(SharePointAccount."Account Id") then + if IsNullGuid(TempSharePointAccount."Account Id") then exit(false); - FileAccount := SharePointAccount; + FileAccount := TempSharePointAccount; exit(true); end; diff --git a/src/Apps/W1/External File Storage - SharePoint Connector/App/src/ExtSharePointConnectorImpl.Codeunit.al b/src/Apps/W1/External File Storage - SharePoint Connector/App/src/ExtSharePointConnectorImpl.Codeunit.al index cf8be00aaf..5be0b987b6 100644 --- a/src/Apps/W1/External File Storage - SharePoint Connector/App/src/ExtSharePointConnectorImpl.Codeunit.al +++ b/src/Apps/W1/External File Storage - SharePoint Connector/App/src/ExtSharePointConnectorImpl.Codeunit.al @@ -30,28 +30,28 @@ codeunit 4580 "Ext. SharePoint Connector Impl" implements "External File Storage /// A list with all files stored in the path. procedure ListFiles(AccountId: Guid; Path: Text; FilePaginationData: Codeunit "File Pagination Data"; var TempFileAccountContent: Record "File Account Content" temporary) var - SharePointFile: Record "SharePoint File"; + TempSharePointFile: Record "SharePoint File"; SharePointClient: Codeunit "SharePoint Client"; OrginalPath: Text; begin OrginalPath := Path; InitPath(AccountId, Path); InitSharePointClient(AccountId, SharePointClient); - if not SharePointClient.GetFolderFilesByServerRelativeUrl(Path, SharePointFile) then + if not SharePointClient.GetFolderFilesByServerRelativeUrl(Path, TempSharePointFile) then ShowError(SharePointClient); FilePaginationData.SetEndOfListing(true); - if not SharePointFile.FindSet() then + if not TempSharePointFile.FindSet() then exit; repeat TempFileAccountContent.Init(); - TempFileAccountContent.Name := SharePointFile.Name; + TempFileAccountContent.Name := TempSharePointFile.Name; TempFileAccountContent.Type := TempFileAccountContent.Type::"File"; TempFileAccountContent."Parent Directory" := CopyStr(OrginalPath, 1, MaxStrLen(TempFileAccountContent."Parent Directory")); TempFileAccountContent.Insert(); - until SharePointFile.Next() = 0; + until TempSharePointFile.Next() = 0; end; /// @@ -85,14 +85,14 @@ codeunit 4580 "Ext. SharePoint Connector Impl" implements "External File Storage /// The Stream were the file is read from. procedure CreateFile(AccountId: Guid; Path: Text; Stream: InStream) var - SharePointFile: Record "SharePoint File"; + TempSharePointFile: Record "SharePoint File"; SharePointClient: Codeunit "SharePoint Client"; ParentPath, FileName : Text; begin InitPath(AccountId, Path); InitSharePointClient(AccountId, SharePointClient); SplitPath(Path, ParentPath, FileName); - if SharePointClient.AddFileToFolder(ParentPath, FileName, Stream, SharePointFile, false) then + if SharePointClient.AddFileToFolder(ParentPath, FileName, Stream, TempSharePointFile, false) then exit; ShowError(SharePointClient); @@ -138,16 +138,16 @@ codeunit 4580 "Ext. SharePoint Connector Impl" implements "External File Storage /// Returns true if the file exists procedure FileExists(AccountId: Guid; Path: Text): Boolean var - SharePointFile: Record "SharePoint File"; + TempSharePointFile: Record "SharePoint File"; SharePointClient: Codeunit "SharePoint Client"; begin InitPath(AccountId, Path); InitSharePointClient(AccountId, SharePointClient); - if not SharePointClient.GetFolderFilesByServerRelativeUrl(GetParentPath(Path), SharePointFile) then + if not SharePointClient.GetFolderFilesByServerRelativeUrl(GetParentPath(Path), TempSharePointFile) then ShowError(SharePointClient); - SharePointFile.SetRange(Name, GetFileName(Path)); - exit(not SharePointFile.IsEmpty()); + TempSharePointFile.SetRange(Name, GetFileName(Path)); + exit(not TempSharePointFile.IsEmpty()); end; /// @@ -176,28 +176,28 @@ codeunit 4580 "Ext. SharePoint Connector Impl" implements "External File Storage /// A list with all directories stored in the path. procedure ListDirectories(AccountId: Guid; Path: Text; FilePaginationData: Codeunit "File Pagination Data"; var TempFileAccountContent: Record "File Account Content" temporary) var - SharePointFolder: Record "SharePoint Folder"; + TempSharePointFolder: Record "SharePoint Folder"; SharePointClient: Codeunit "SharePoint Client"; OrginalPath: Text; begin OrginalPath := Path; InitPath(AccountId, Path); InitSharePointClient(AccountId, SharePointClient); - if not SharePointClient.GetSubFoldersByServerRelativeUrl(Path, SharePointFolder) then + if not SharePointClient.GetSubFoldersByServerRelativeUrl(Path, TempSharePointFolder) then ShowError(SharePointClient); FilePaginationData.SetEndOfListing(true); - if not SharePointFolder.FindSet() then + if not TempSharePointFolder.FindSet() then exit; repeat TempFileAccountContent.Init(); - TempFileAccountContent.Name := SharePointFolder.Name; + TempFileAccountContent.Name := TempSharePointFolder.Name; TempFileAccountContent.Type := TempFileAccountContent.Type::Directory; TempFileAccountContent."Parent Directory" := CopyStr(OrginalPath, 1, MaxStrLen(TempFileAccountContent."Parent Directory")); TempFileAccountContent.Insert(); - until SharePointFolder.Next() = 0; + until TempSharePointFolder.Next() = 0; end; /// @@ -207,12 +207,12 @@ codeunit 4580 "Ext. SharePoint Connector Impl" implements "External File Storage /// The directory path inside the file account. procedure CreateDirectory(AccountId: Guid; Path: Text) var - SharePointFolder: Record "SharePoint Folder"; + TempSharePointFolder: Record "SharePoint Folder"; SharePointClient: Codeunit "SharePoint Client"; begin InitPath(AccountId, Path); InitSharePointClient(AccountId, SharePointClient); - if SharePointClient.CreateFolder(Path, SharePointFolder) then + if SharePointClient.CreateFolder(Path, TempSharePointFolder) then exit; ShowError(SharePointClient); diff --git a/src/Apps/W1/External File Storage - SharePoint Connector/Test/src/ExtSharePointConnectorTest.Codeunit.al b/src/Apps/W1/External File Storage - SharePoint Connector/Test/src/ExtSharePointConnectorTest.Codeunit.al index 0e0f715dc4..f487f09782 100644 --- a/src/Apps/W1/External File Storage - SharePoint Connector/Test/src/ExtSharePointConnectorTest.Codeunit.al +++ b/src/Apps/W1/External File Storage - SharePoint Connector/Test/src/ExtSharePointConnectorTest.Codeunit.al @@ -20,7 +20,7 @@ codeunit 144581 "Ext. SharePoint Connector Test" [TransactionModel(TransactionModel::AutoRollback)] procedure TestMultipleAccountsCanBeRegistered() var - FileAccount: Record "File Account"; + TempFileAccount: Record "File Account"; ExtFileConnector: Codeunit "Ext. SharePoint Connector Impl"; FileAccounts: TestPage "File Accounts"; AccountIds: array[3] of Guid; @@ -34,14 +34,14 @@ codeunit 144581 "Ext. SharePoint Connector Test" for Index := 1 to 3 do begin SetBasicAccount(); - Assert.IsTrue(ExtFileConnector.RegisterAccount(FileAccount), 'Failed to register account.'); - AccountIds[Index] := FileAccount."Account Id"; + Assert.IsTrue(ExtFileConnector.RegisterAccount(TempFileAccount), 'Failed to register account.'); + AccountIds[Index] := TempFileAccount."Account Id"; AccountName[Index] := FileAccountMock.Name(); // [Then] Accounts are retrieved from the GetAccounts method - FileAccount.DeleteAll(); - ExtFileConnector.GetAccounts(FileAccount); - Assert.RecordCount(FileAccount, Index); + TempFileAccount.DeleteAll(); + ExtFileConnector.GetAccounts(TempFileAccount); + Assert.RecordCount(TempFileAccount, Index); end; FileAccounts.OpenView(); @@ -57,7 +57,7 @@ codeunit 144581 "Ext. SharePoint Connector Test" [TransactionModel(TransactionModel::AutoRollback)] procedure TestEnviromentCleanupDisablesAccounts() var - FileAccount: Record "File Account"; + TempFileAccount: Record "File Account"; ExtSharePointAccount: Record "Ext. SharePoint Account"; ExtFileConnector: Codeunit "Ext. SharePoint Connector Impl"; EnvironmentTriggers: Codeunit "Environment Triggers"; @@ -71,13 +71,13 @@ codeunit 144581 "Ext. SharePoint Connector Test" for Index := 1 to 3 do begin SetBasicAccount(); - Assert.IsTrue(ExtFileConnector.RegisterAccount(FileAccount), 'Failed to register account.'); - AccountIds[Index] := FileAccount."Account Id"; + Assert.IsTrue(ExtFileConnector.RegisterAccount(TempFileAccount), 'Failed to register account.'); + AccountIds[Index] := TempFileAccount."Account Id"; // [Then] Accounts are retrieved from the GetAccounts method - FileAccount.DeleteAll(); - ExtFileConnector.GetAccounts(FileAccount); - Assert.RecordCount(FileAccount, Index); + TempFileAccount.DeleteAll(); + ExtFileConnector.GetAccounts(TempFileAccount); + Assert.RecordCount(TempFileAccount, Index); end; ExtSharePointAccount.SetRange(Disabled, true); @@ -94,7 +94,7 @@ codeunit 144581 "Ext. SharePoint Connector Test" [TransactionModel(TransactionModel::AutoRollback)] procedure TestShowAccountInformation() var - FileAccount: Record "File Account"; + TempFileAccount: Record "File Account"; FileConnector: Codeunit "Ext. SharePoint Connector Impl"; begin // [Scenario] Account Information is displayed in the Account page. @@ -102,10 +102,10 @@ codeunit 144581 "Ext. SharePoint Connector Test" // [Given] An file account Initialize(); SetBasicAccount(); - FileConnector.RegisterAccount(FileAccount); + FileConnector.RegisterAccount(TempFileAccount); // [When] The ShowAccountInformation method is invoked - FileConnector.ShowAccountInformation(FileAccount."Account Id"); + FileConnector.ShowAccountInformation(TempFileAccount."Account Id"); // [Then] The account page opens and displays the information // Verify in AccountModalPageHandler diff --git a/src/Apps/W1/External Storage - Document Attachments/app/src/DocumentAttachmentIntegration/DAExternalStorageImpl.Codeunit.al b/src/Apps/W1/External Storage - Document Attachments/app/src/DocumentAttachmentIntegration/DAExternalStorageImpl.Codeunit.al index e1938182b9..d8ef9a0151 100644 --- a/src/Apps/W1/External Storage - Document Attachments/app/src/DocumentAttachmentIntegration/DAExternalStorageImpl.Codeunit.al +++ b/src/Apps/W1/External Storage - Document Attachments/app/src/DocumentAttachmentIntegration/DAExternalStorageImpl.Codeunit.al @@ -31,7 +31,7 @@ codeunit 8751 "DA External Storage Impl." implements "File Scenario" procedure BeforeAddOrModifyFileScenarioCheck(Scenario: Enum "File Scenario"; Connector: Enum "Ext. File Storage Connector"): Boolean; var ExternalStorageSetup: Record "DA External Storage Setup"; - FileAccount: Record "File Account"; + TempFileAccount: Record "File Account"; FileScenarioCU: Codeunit "File Scenario"; ConfirmManagement: Codeunit "Confirm Management"; ExternalStorageSetupPage: Page "DA External Storage Setup"; @@ -42,7 +42,7 @@ codeunit 8751 "DA External Storage Impl." implements "File Scenario" exit; // Check if scenario is already assigned to a different account - if FileScenarioCU.GetSpecificFileAccount(Scenario, FileAccount) then + if FileScenarioCU.GetSpecificFileAccount(Scenario, TempFileAccount) then // If feature is enabled and has uploaded files, don't allow reassignment if ExternalStorageSetup.Get() then if ExternalStorageSetup.Enabled then begin @@ -133,7 +133,7 @@ codeunit 8751 "DA External Storage Impl." implements "File Scenario" /// True if upload was successful, false otherwise. procedure UploadToExternalStorage(var DocumentAttachment: Record "Document Attachment"): Boolean var - FileAccount: Record "File Account"; + TempFileAccount: Record "File Account"; ExternalFileStorage: Codeunit "External File Storage"; FileScenarioCU: Codeunit "File Scenario"; DAFeatureTelemetry: Codeunit "DA Feature Telemetry"; @@ -168,7 +168,7 @@ codeunit 8751 "DA External Storage Impl." implements "File Scenario" // Search for External Storage assigned File Scenario FileScenario := FileScenario::"Doc. Attach. - External Storage"; - if not FileScenarioCU.GetSpecificFileAccount(FileScenario, FileAccount) then + if not FileScenarioCU.GetSpecificFileAccount(FileScenario, TempFileAccount) then exit(false); // Create the file with connector using the File Account framework @@ -193,7 +193,7 @@ codeunit 8751 "DA External Storage Impl." implements "File Scenario" /// True if download was successful, false otherwise. procedure DownloadFromExternalStorage(var DocumentAttachment: Record "Document Attachment"): Boolean var - FileAccount: Record "File Account"; + TempFileAccount: Record "File Account"; ExternalFileStorage: Codeunit "External File Storage"; FileScenarioCU: Codeunit "File Scenario"; DAFeatureTelemetry: Codeunit "DA Feature Telemetry"; @@ -218,7 +218,7 @@ codeunit 8751 "DA External Storage Impl." implements "File Scenario" // Search for External Storage assigned File Scenario FileScenario := FileScenario::"Doc. Attach. - External Storage"; - if not FileScenarioCU.GetSpecificFileAccount(FileScenario, FileAccount) then + if not FileScenarioCU.GetSpecificFileAccount(FileScenario, TempFileAccount) then exit(false); // Get the file with connector using the File Account framework @@ -240,7 +240,7 @@ codeunit 8751 "DA External Storage Impl." implements "File Scenario" /// True if download and import was successful, false otherwise. procedure DownloadFromExternalStorageToInternal(var DocumentAttachment: Record "Document Attachment"): Boolean var - FileAccount: Record "File Account"; + TempFileAccount: Record "File Account"; ExternalFileStorage: Codeunit "External File Storage"; FileScenarioCU: Codeunit "File Scenario"; FileScenario: Enum "File Scenario"; @@ -260,7 +260,7 @@ codeunit 8751 "DA External Storage Impl." implements "File Scenario" // Search for External Storage assigned File Scenario FileScenario := FileScenario::"Doc. Attach. - External Storage"; - if not FileScenarioCU.GetSpecificFileAccount(FileScenario, FileAccount) then + if not FileScenarioCU.GetSpecificFileAccount(FileScenario, TempFileAccount) then exit(false); // Get the file with connector using the File Account framework @@ -284,7 +284,7 @@ codeunit 8751 "DA External Storage Impl." implements "File Scenario" /// True if the download was successful, false otherwise. procedure DownloadFromExternalStorageToStream(ExternalFilePath: Text; var AttachmentOutStream: OutStream): Boolean var - FileAccount: Record "File Account"; + TempFileAccount: Record "File Account"; ExternalFileStorage: Codeunit "External File Storage"; FileScenarioCU: Codeunit "File Scenario"; FileScenario: Enum "File Scenario"; @@ -292,7 +292,7 @@ codeunit 8751 "DA External Storage Impl." implements "File Scenario" begin // Search for External Storage assigned File Scenario FileScenario := FileScenario::"Doc. Attach. - External Storage"; - if not FileScenarioCU.GetSpecificFileAccount(FileScenario, FileAccount) then + if not FileScenarioCU.GetSpecificFileAccount(FileScenario, TempFileAccount) then exit(false); // Get the file from external storage @@ -313,7 +313,7 @@ codeunit 8751 "DA External Storage Impl." implements "File Scenario" /// True if the download was successful, false otherwise. procedure DownloadFromExternalStorageToTempBlob(ExternalFilePath: Text; var TempBlob: Codeunit "Temp Blob"): Boolean var - FileAccount: Record "File Account"; + TempFileAccount: Record "File Account"; ExternalFileStorage: Codeunit "External File Storage"; FileScenarioCU: Codeunit "File Scenario"; FileScenario: Enum "File Scenario"; @@ -322,7 +322,7 @@ codeunit 8751 "DA External Storage Impl." implements "File Scenario" begin // Search for External Storage assigned File Scenario FileScenario := FileScenario::"Doc. Attach. - External Storage"; - if not FileScenarioCU.GetSpecificFileAccount(FileScenario, FileAccount) then + if not FileScenarioCU.GetSpecificFileAccount(FileScenario, TempFileAccount) then exit(false); // Get the file from external storage @@ -343,14 +343,14 @@ codeunit 8751 "DA External Storage Impl." implements "File Scenario" /// True if the file exists, false otherwise. procedure CheckIfFileExistInExternalStorage(ExternalFilePath: Text): Boolean var - FileAccount: Record "File Account"; + TempFileAccount: Record "File Account"; ExternalFileStorage: Codeunit "External File Storage"; FileScenarioCU: Codeunit "File Scenario"; FileScenario: Enum "File Scenario"; begin // Search for External Storage assigned File Scenario FileScenario := FileScenario::"Doc. Attach. - External Storage"; - if not FileScenarioCU.GetSpecificFileAccount(FileScenario, FileAccount) then + if not FileScenarioCU.GetSpecificFileAccount(FileScenario, TempFileAccount) then exit(false); // Get the file from external storage @@ -365,7 +365,7 @@ codeunit 8751 "DA External Storage Impl." implements "File Scenario" /// True if deletion was successful, false otherwise. procedure DeleteFromExternalStorage(var DocumentAttachment: Record "Document Attachment"): Boolean var - FileAccount: Record "File Account"; + TempFileAccount: Record "File Account"; ExternalFileStorage: Codeunit "External File Storage"; FileScenarioCU: Codeunit "File Scenario"; DAFeatureTelemetry: Codeunit "DA Feature Telemetry"; @@ -400,7 +400,7 @@ codeunit 8751 "DA External Storage Impl." implements "File Scenario" // Search for External Storage assigned File Scenario FileScenario := FileScenario::"Doc. Attach. - External Storage"; - if not FileScenarioCU.GetSpecificFileAccount(FileScenario, FileAccount) then + if not FileScenarioCU.GetSpecificFileAccount(FileScenario, TempFileAccount) then exit(false); // Delete the file with connector using the File Account framework @@ -519,7 +519,7 @@ codeunit 8751 "DA External Storage Impl." implements "File Scenario" /// The selected folder path, or empty string if cancelled. procedure SelectRootFolder(): Text var - FileAccount: Record "File Account"; + TempFileAccount: Record "File Account"; ExternalFileStorage: Codeunit "External File Storage"; FileScenarioCU: Codeunit "File Scenario"; SelectFolderPathLbl: Label 'Select Root Folder for Attachments'; @@ -527,7 +527,7 @@ codeunit 8751 "DA External Storage Impl." implements "File Scenario" begin // Initialize external file storage with the scenario FileScenario := FileScenario::"Doc. Attach. - External Storage"; - if not FileScenarioCU.GetSpecificFileAccount(FileScenario, FileAccount) then + if not FileScenarioCU.GetSpecificFileAccount(FileScenario, TempFileAccount) then exit(''); ExternalFileStorage.Initialize(FileScenario); @@ -612,14 +612,14 @@ codeunit 8751 "DA External Storage Impl." implements "File Scenario" local procedure EnsureFolderExists(CompanyFolderPath: Text) var - FileAccount: Record "File Account"; + TempFileAccount: Record "File Account"; ExternalFileStorage: Codeunit "External File Storage"; FileScenarioCU: Codeunit "File Scenario"; FileScenario: Enum "File Scenario"; begin // Initialize external file storage with the scenario FileScenario := FileScenario::"Doc. Attach. - External Storage"; - if not FileScenarioCU.GetSpecificFileAccount(FileScenario, FileAccount) then + if not FileScenarioCU.GetSpecificFileAccount(FileScenario, TempFileAccount) then exit; ExternalFileStorage.Initialize(FileScenario); @@ -674,7 +674,7 @@ codeunit 8751 "DA External Storage Impl." implements "File Scenario" /// True if migration was successful, false otherwise. procedure MigrateFileToCurrentEnvironment(var DocumentAttachment: Record "Document Attachment"): Boolean var - FileAccount: Record "File Account"; + TempFileAccount: Record "File Account"; ExternalFileStorage: Codeunit "External File Storage"; FileScenarioCU: Codeunit "File Scenario"; TempBlob: Codeunit "Temp Blob"; @@ -692,7 +692,7 @@ codeunit 8751 "DA External Storage Impl." implements "File Scenario" // Initialize external file storage FileScenario := FileScenario::"Doc. Attach. - External Storage"; - if not FileScenarioCU.GetSpecificFileAccount(FileScenario, FileAccount) then + if not FileScenarioCU.GetSpecificFileAccount(FileScenario, TempFileAccount) then exit(false); ExternalFileStorage.Initialize(FileScenario); diff --git a/src/Apps/W1/PowerBIReports/App/Core/Pages/PowerBISelectionLookup.Page.al b/src/Apps/W1/PowerBIReports/App/Core/Pages/PowerBISelectionLookup.Page.al index 27ca8a2f75..f2e5103103 100644 --- a/src/Apps/W1/PowerBIReports/App/Core/Pages/PowerBISelectionLookup.Page.al +++ b/src/Apps/W1/PowerBIReports/App/Core/Pages/PowerBISelectionLookup.Page.al @@ -52,10 +52,10 @@ page 36963 "Power BI Selection Lookup" trigger OnOpenPage() var - PowerBISelectionElement: Record "Power BI Selection Element"; + TempPowerBISelectionElement: Record "Power BI Selection Element"; SelectTxt: Label 'Select Power BI %1', Comment = '%1 = Type'; begin - if Evaluate(PowerBISelectionElement.Type, Rec.GetFilter(Type)) then - CurrPage.Caption := StrSubstNo(SelectTxt, PowerBISelectionElement.Type); + if Evaluate(TempPowerBISelectionElement.Type, Rec.GetFilter(Type)) then + CurrPage.Caption := StrSubstNo(SelectTxt, TempPowerBISelectionElement.Type); end; } \ No newline at end of file diff --git a/src/Apps/W1/SendToEmailPrinter/App/src/DocumentPrintReady.Codeunit.al b/src/Apps/W1/SendToEmailPrinter/App/src/DocumentPrintReady.Codeunit.al index a156653e64..9a6760ff86 100644 --- a/src/Apps/W1/SendToEmailPrinter/App/src/DocumentPrintReady.Codeunit.al +++ b/src/Apps/W1/SendToEmailPrinter/App/src/DocumentPrintReady.Codeunit.al @@ -77,13 +77,13 @@ codeunit 2651 "Document Print Ready" local procedure SendEmailByEmailFeature(ToList: List of [Text]; EmailSubject: Text[250]; EmailBody: Text[2048]; DocumentStream: InStream; AttachmentName: Text[250]): Boolean var - EmailAccount: Record "Email Account"; + TempEmailAccount: Record "Email Account"; Email: Codeunit Email; Message: Codeunit "Email Message"; EmailScenario: Codeunit "Email Scenario"; begin // exit if email account is not set for Email Printer scenario - if not EmailScenario.GetEmailAccount(Enum::"Email Scenario"::"Email Printer", EmailAccount) then begin + if not EmailScenario.GetEmailAccount(Enum::"Email Scenario"::"Email Printer", TempEmailAccount) then begin if GuiAllowed() then Message(NoEmailAccountDefinedErr, Enum::"Email Scenario"::"Email Printer"); Session.LogMessage('0000D6E', NoEmailAccountTxt, Verbosity::Normal, DataClassification::SystemMetadata, TelemetryScope::ExtensionPublisher, 'Category', EmailPrinterTelemetryCategoryTok); @@ -96,7 +96,7 @@ codeunit 2651 "Document Print Ready" ClearLastError(); // exit if sending message fails - if not Email.Send(Message, EmailAccount."Account Id", EmailAccount.Connector) then begin + if not Email.Send(Message, TempEmailAccount."Account Id", TempEmailAccount.Connector) then begin if GuiAllowed() then Message(SendErr, GetLastErrorText()); Session.LogMessage('0000BGK', NotSentTelemetryTxt, Verbosity::Normal, DataClassification::SystemMetadata, TelemetryScope::ExtensionPublisher, 'Category', EmailPrinterTelemetryCategoryTok); diff --git a/src/Apps/W1/SendToEmailPrinter/App/src/EmailPrinterSettings.Page.al b/src/Apps/W1/SendToEmailPrinter/App/src/EmailPrinterSettings.Page.al index ace438b519..a3b16288be 100644 --- a/src/Apps/W1/SendToEmailPrinter/App/src/EmailPrinterSettings.Page.al +++ b/src/Apps/W1/SendToEmailPrinter/App/src/EmailPrinterSettings.Page.al @@ -238,11 +238,11 @@ page 2650 "Email Printer Settings" trigger OnAfterGetCurrRecord() var - EmailAccount: Record "Email Account"; + TempEmailAccount: Record "Email Account"; EmailScenario: Codeunit "Email Scenario"; begin IsSizeCustom := SetupPrinters.IsPaperSizeCustom(Rec."Paper Size"); - HasEmailAccountPermission := EmailAccount.WritePermission(); - IsEmailAccountDefined := EmailScenario.GetEmailAccount(Enum::"Email Scenario"::"Email Printer", EmailAccount); + HasEmailAccountPermission := TempEmailAccount.WritePermission(); + IsEmailAccountDefined := EmailScenario.GetEmailAccount(Enum::"Email Scenario"::"Email Printer", TempEmailAccount); end; } diff --git a/src/Apps/W1/Shopify/Test/Base/ShpfyFilterMgtTest.Codeunit.al b/src/Apps/W1/Shopify/Test/Base/ShpfyFilterMgtTest.Codeunit.al index 0475b715b8..d9e97b8f7e 100644 --- a/src/Apps/W1/Shopify/Test/Base/ShpfyFilterMgtTest.Codeunit.al +++ b/src/Apps/W1/Shopify/Test/Base/ShpfyFilterMgtTest.Codeunit.al @@ -22,7 +22,7 @@ codeunit 139560 "Shpfy Filter Mgt. Test" [Test] procedure UnitTestCleanFilterValue() var - TestFields: Record "Shpfy Test Fields"; + TempTestFields: Record "Shpfy Test Fields"; FilterMgt: Codeunit "Shpfy Filter Mgt."; Index: Integer; InvalidCharsTxt: Label '()*.<>=', Locked = true; @@ -30,9 +30,9 @@ codeunit 139560 "Shpfy Filter Mgt. Test" begin // Creating Test data. for Index := 1 to StrLen(Format(InvalidCharsTxt)) do begin - TestFields.BigIntegerField := Index; - TestFields.TextField := Any.AlphabeticText(5 + Index) + Format(InvalidCharsTxt) [Index] + Any.AlphabeticText(3); - TestFields.Insert(); + TempTestFields.BigIntegerField := Index; + TempTestFields.TextField := Any.AlphabeticText(5 + Index) + Format(InvalidCharsTxt) [Index] + Any.AlphabeticText(3); + TempTestFields.Insert(); end; // [SCENARIO] Create for every record a searchstring with the function CleanFilterValue @@ -40,16 +40,16 @@ codeunit 139560 "Shpfy Filter Mgt. Test" // the result must be that 1 record is found. // [GIVEN] Textfield to convert for creating a search string. - if TestFields.FindSet(false) then + if TempTestFields.FindSet(false) then repeat - SearchStrings.Add(FilterMgt.CleanFilterValue(TestFields.TextField)); - until TestFields.Next() = 0; + SearchStrings.Add(FilterMgt.CleanFilterValue(TempTestFields.TextField)); + until TempTestFields.Next() = 0; // [WHEN] filtering on a searchstring // [THEN] this must give a result of 1 record back. for Index := 1 to SearchStrings.Count do begin - TestFields.SetFilter(TextField, SearchStrings.Get(Index)); - LibraryAssert.RecordCount(TestFields, 1); + TempTestFields.SetFilter(TextField, SearchStrings.Get(Index)); + LibraryAssert.RecordCount(TempTestFields, 1); end; end; } \ No newline at end of file diff --git a/src/Apps/W1/Shopify/Test/Helpers/ShpfyJsonHelperTest.Codeunit.al b/src/Apps/W1/Shopify/Test/Helpers/ShpfyJsonHelperTest.Codeunit.al index edde6601a8..faf79c90ac 100644 --- a/src/Apps/W1/Shopify/Test/Helpers/ShpfyJsonHelperTest.Codeunit.al +++ b/src/Apps/W1/Shopify/Test/Helpers/ShpfyJsonHelperTest.Codeunit.al @@ -875,8 +875,8 @@ codeunit 139574 "Shpfy Json Helper Test" [Test] procedure UnitTestValueIntoField() var - TestFields: Record "Shpfy Test Fields"; - TestFields2: Record "Shpfy Test Fields"; + TempTestFields: Record "Shpfy Test Fields"; + TempTestFields2: Record "Shpfy Test Fields"; RecordRef: RecordRef; FieldRef: FieldRef; FieldNo: Integer; @@ -884,191 +884,191 @@ codeunit 139574 "Shpfy Json Helper Test" Path: Text; begin // Creating Test data and expected results. - TestFields := TestFields.CreateNewRecordWithAnyValues(); - JObject.Add(TestFields.FieldName(BigIntegerField), TestFields.BigIntegerField); - JObject.Add(TestFields.FieldName(BlobField), TestFields.GetBlobData()); - JObject.Add(TestFields.FieldName(BooleanField), TestFields.BooleanField); - JObject.Add(TestFields.FieldName(CodeField), TestFields.CodeField); - JObject.Add(TestFields.FieldName(TextField), TestFields.TextField); - JObject.Add(TestFields.FieldName(DateField), TestFields.DateField); - JObject.Add(TestFields.FieldName(DateTimeField), TestFields.DateTimeField); - JObject.Add(TestFields.FieldName(DecimalField), TestFields.DecimalField); - JObject.Add(TestFields.FieldName(DurationField), TestFields.DurationField); - JObject.Add(TestFields.FieldName(GuidField), TestFields.GuidField); - JObject.Add(TestFields.FieldName(IntegerField), TestFields.IntegerField); - JObject.Add(TestFields.FieldName(OptionField), TestFields.OptionField); - JObject.Add(TestFields.FieldName(TimeField), TestFields.TimeField); + TempTestFields := TempTestFields.CreateNewRecordWithAnyValues(); + JObject.Add(TempTestFields.FieldName(BigIntegerField), TempTestFields.BigIntegerField); + JObject.Add(TempTestFields.FieldName(BlobField), TempTestFields.GetBlobData()); + JObject.Add(TempTestFields.FieldName(BooleanField), TempTestFields.BooleanField); + JObject.Add(TempTestFields.FieldName(CodeField), TempTestFields.CodeField); + JObject.Add(TempTestFields.FieldName(TextField), TempTestFields.TextField); + JObject.Add(TempTestFields.FieldName(DateField), TempTestFields.DateField); + JObject.Add(TempTestFields.FieldName(DateTimeField), TempTestFields.DateTimeField); + JObject.Add(TempTestFields.FieldName(DecimalField), TempTestFields.DecimalField); + JObject.Add(TempTestFields.FieldName(DurationField), TempTestFields.DurationField); + JObject.Add(TempTestFields.FieldName(GuidField), TempTestFields.GuidField); + JObject.Add(TempTestFields.FieldName(IntegerField), TempTestFields.IntegerField); + JObject.Add(TempTestFields.FieldName(OptionField), TempTestFields.OptionField); + JObject.Add(TempTestFields.FieldName(TimeField), TempTestFields.TimeField); RecordRef.Open(Database::"Shpfy Test Fields"); // [SCENARIO] Get values out of a Json structure and put the in to a field of a record. #region BigInteger // [GIVEN] A JsonObject that contains the data. // [GIVEN] A Path to the value. - Path := TestFields.FieldName(BigIntegerField); + Path := TempTestFields.FieldName(BigIntegerField); // [GIVEN] A RecordRef of an record. // [GIVEN] A FieldNo of a BigInteger field - FieldNo := TestFields.FieldNo(BigIntegerField); + FieldNo := TempTestFields.FieldNo(BigIntegerField); JsonHelper.GetValueIntoField(JObject, Path, RecordRef, FieldNo); // [THEN] TestField.BigIntegerField = RecRef.Field(TestField.FieldNo(BigIntegerField)).Value - FieldRef := RecordRef.Field(TestFields.FieldNo(BigIntegerField)); - LibraryAssert.AreEqual(TestFields.BigIntegerField, FieldRef.Value, Format(FieldRef.Type)); + FieldRef := RecordRef.Field(TempTestFields.FieldNo(BigIntegerField)); + LibraryAssert.AreEqual(TempTestFields.BigIntegerField, FieldRef.Value, Format(FieldRef.Type)); #endregion BigInteger #region Blob // [GIVEN] A JsonObject that contains the data. // [GIVEN] A Path to the value. - Path := TestFields.FieldName(BlobField); + Path := TempTestFields.FieldName(BlobField); // [GIVEN] A RecordRef of an record. // [GIVEN] A FieldNo of a BlobField field - FieldNo := TestFields.FieldNo(BlobField); + FieldNo := TempTestFields.FieldNo(BlobField); JsonHelper.GetValueIntoField(JObject, Path, RecordRef, FieldNo); // [THEN] TestField.GetBlobData() = TestField2.GetBlobData() - FieldRef := RecordRef.Field(TestFields.FieldNo(BigIntegerField)); - RecordRef.SetTable(TestFields2); - LibraryAssert.AreEqual(TestFields.GetBlobData(), TestFields2.GetBlobData(), Format(FieldRef.Type)); + FieldRef := RecordRef.Field(TempTestFields.FieldNo(BigIntegerField)); + RecordRef.SetTable(TempTestFields2); + LibraryAssert.AreEqual(TempTestFields.GetBlobData(), TempTestFields2.GetBlobData(), Format(FieldRef.Type)); #endregion #region Boolean // [GIVEN] A JsonObject that contains the data. // [GIVEN] A Path to the value. - Path := TestFields.FieldName(BooleanField); + Path := TempTestFields.FieldName(BooleanField); // [GIVEN] A RecordRef of an record. // [GIVEN] A FieldNo of a BooleanField field - FieldNo := TestFields.FieldNo(BooleanField); + FieldNo := TempTestFields.FieldNo(BooleanField); JsonHelper.GetValueIntoField(JObject, Path, RecordRef, FieldNo); // [THEN] TestField.BooleanField = RecRef.Field(TestField.FieldNo(BooleanField)).Value - FieldRef := RecordRef.Field(TestFields.FieldNo(BooleanField)); - LibraryAssert.AreEqual(TestFields.BooleanField, FieldRef.Value, Format(FieldRef.Type)); + FieldRef := RecordRef.Field(TempTestFields.FieldNo(BooleanField)); + LibraryAssert.AreEqual(TempTestFields.BooleanField, FieldRef.Value, Format(FieldRef.Type)); #endregion Boolean #region Code // [GIVEN] A JsonObject that contains the data. // [GIVEN] A Path to the value. - Path := TestFields.FieldName(CodeField); + Path := TempTestFields.FieldName(CodeField); // [GIVEN] A RecordRef of an record. // [GIVEN] A FieldNo of a CodeField field - FieldNo := TestFields.FieldNo(CodeField); + FieldNo := TempTestFields.FieldNo(CodeField); JsonHelper.GetValueIntoField(JObject, Path, RecordRef, FieldNo); // [THEN] TestField.CodeField = RecRef.Field(TestField.FieldNo(CodeField)).Value - FieldRef := RecordRef.Field(TestFields.FieldNo(CodeField)); - LibraryAssert.AreEqual(TestFields.CodeField, FieldRef.Value, Format(FieldRef.Type)); + FieldRef := RecordRef.Field(TempTestFields.FieldNo(CodeField)); + LibraryAssert.AreEqual(TempTestFields.CodeField, FieldRef.Value, Format(FieldRef.Type)); #endregion Code #region Text // [GIVEN] A JsonObject that contains the data. // [GIVEN] A Path to the value. - Path := TestFields.FieldName(TextField); + Path := TempTestFields.FieldName(TextField); // [GIVEN] A RecordRef of an record. // [GIVEN] A FieldNo of a TextField field - FieldNo := TestFields.FieldNo(TextField); + FieldNo := TempTestFields.FieldNo(TextField); JsonHelper.GetValueIntoField(JObject, Path, RecordRef, FieldNo); // [THEN] TestField.TextField = RecRef.Field(TestField.FieldNo(TextField)).Value - FieldRef := RecordRef.Field(TestFields.FieldNo(TextField)); - LibraryAssert.AreEqual(TestFields.TextField, FieldRef.Value, Format(FieldRef.Type)); + FieldRef := RecordRef.Field(TempTestFields.FieldNo(TextField)); + LibraryAssert.AreEqual(TempTestFields.TextField, FieldRef.Value, Format(FieldRef.Type)); #endregion Text #region Date // [GIVEN] A JsonObject that contains the data. // [GIVEN] A Path to the value. - Path := TestFields.FieldName(DateField); + Path := TempTestFields.FieldName(DateField); // [GIVEN] A RecordRef of an record. // [GIVEN] A FieldNo of a DateField field - FieldNo := TestFields.FieldNo(DateField); + FieldNo := TempTestFields.FieldNo(DateField); JsonHelper.GetValueIntoField(JObject, Path, RecordRef, FieldNo); // [THEN] TestField.DateField = RecRef.Field(TestField.FieldNo(DateField)).Value - FieldRef := RecordRef.Field(TestFields.FieldNo(DateField)); - LibraryAssert.AreEqual(TestFields.DateField, FieldRef.Value, Format(FieldRef.Type)); + FieldRef := RecordRef.Field(TempTestFields.FieldNo(DateField)); + LibraryAssert.AreEqual(TempTestFields.DateField, FieldRef.Value, Format(FieldRef.Type)); #endregion Date #region DateTime // [GIVEN] A JsonObject that contains the data. // [GIVEN] A Path to the value. - Path := TestFields.FieldName(DateTimeField); + Path := TempTestFields.FieldName(DateTimeField); // [GIVEN] A RecordRef of an record. // [GIVEN] A FieldNo of a DateTimeField field - FieldNo := TestFields.FieldNo(DateTimeField); + FieldNo := TempTestFields.FieldNo(DateTimeField); JsonHelper.GetValueIntoField(JObject, Path, RecordRef, FieldNo); // [THEN] TestField.DateTimeField = RecRef.Field(TestField.FieldNo(DateTimeField)).Value - FieldRef := RecordRef.Field(TestFields.FieldNo(DateTimeField)); - LibraryAssert.AreEqual(TestFields.DateTimeField, FieldRef.Value, Format(FieldRef.Type)); + FieldRef := RecordRef.Field(TempTestFields.FieldNo(DateTimeField)); + LibraryAssert.AreEqual(TempTestFields.DateTimeField, FieldRef.Value, Format(FieldRef.Type)); #endregion DateTime #region Decimal // [GIVEN] A JsonObject that contains the data. // [GIVEN] A Path to the value. - Path := TestFields.FieldName(DecimalField); + Path := TempTestFields.FieldName(DecimalField); // [GIVEN] A RecordRef of an record. // [GIVEN] A FieldNo of a DecimalField field - FieldNo := TestFields.FieldNo(DecimalField); + FieldNo := TempTestFields.FieldNo(DecimalField); JsonHelper.GetValueIntoField(JObject, Path, RecordRef, FieldNo); // [THEN] TestField.DecimalField = RecRef.Field(TestField.FieldNo(DecimalField)).Value - FieldRef := RecordRef.Field(TestFields.FieldNo(DecimalField)); - LibraryAssert.AreEqual(TestFields.DecimalField, FieldRef.Value, Format(FieldRef.Type)); + FieldRef := RecordRef.Field(TempTestFields.FieldNo(DecimalField)); + LibraryAssert.AreEqual(TempTestFields.DecimalField, FieldRef.Value, Format(FieldRef.Type)); #endregion Decimal #region Duration // [GIVEN] A JsonObject that contains the data. // [GIVEN] A Path to the value. - Path := TestFields.FieldName(DurationField); + Path := TempTestFields.FieldName(DurationField); // [GIVEN] A RecordRef of an record. // [GIVEN] A FieldNo of a DurationField field - FieldNo := TestFields.FieldNo(DurationField); + FieldNo := TempTestFields.FieldNo(DurationField); JsonHelper.GetValueIntoField(JObject, Path, RecordRef, FieldNo); // [THEN] TestField.DurationField = RecRef.Field(TestField.FieldNo(DurationField)).Value - FieldRef := RecordRef.Field(TestFields.FieldNo(DurationField)); - LibraryAssert.AreEqual(TestFields.DurationField, FieldRef.Value, Format(FieldRef.Type)); + FieldRef := RecordRef.Field(TempTestFields.FieldNo(DurationField)); + LibraryAssert.AreEqual(TempTestFields.DurationField, FieldRef.Value, Format(FieldRef.Type)); #endregion Duration #region Guid // [GIVEN] A JsonObject that contains the data. // [GIVEN] A Path to the value. - Path := TestFields.FieldName(GuidField); + Path := TempTestFields.FieldName(GuidField); // [GIVEN] A RecordRef of an record. // [GIVEN] A FieldNo of a GuidField field - FieldNo := TestFields.FieldNo(GuidField); + FieldNo := TempTestFields.FieldNo(GuidField); JsonHelper.GetValueIntoField(JObject, Path, RecordRef, FieldNo); // [THEN] TestField.GuidField = RecRef.Field(TestField.FieldNo(GuidField)).Value - FieldRef := RecordRef.Field(TestFields.FieldNo(GuidField)); - LibraryAssert.AreEqual(TestFields.GuidField, FieldRef.Value, Format(FieldRef.Type)); + FieldRef := RecordRef.Field(TempTestFields.FieldNo(GuidField)); + LibraryAssert.AreEqual(TempTestFields.GuidField, FieldRef.Value, Format(FieldRef.Type)); #endregion Guid #region Integer // [GIVEN] A JsonObject that contains the data. // [GIVEN] A Path to the value. - Path := TestFields.FieldName(IntegerField); + Path := TempTestFields.FieldName(IntegerField); // [GIVEN] A RecordRef of an record. // [GIVEN] A FieldNo of a IntegerField field - FieldNo := TestFields.FieldNo(IntegerField); + FieldNo := TempTestFields.FieldNo(IntegerField); JsonHelper.GetValueIntoField(JObject, Path, RecordRef, FieldNo); // [THEN] TestField.IntegerField = RecRef.Field(TestField.FieldNo(IntegerField)).Value - FieldRef := RecordRef.Field(TestFields.FieldNo(IntegerField)); - LibraryAssert.AreEqual(TestFields.IntegerField, FieldRef.Value, Format(FieldRef.Type)); + FieldRef := RecordRef.Field(TempTestFields.FieldNo(IntegerField)); + LibraryAssert.AreEqual(TempTestFields.IntegerField, FieldRef.Value, Format(FieldRef.Type)); #endregion Integer #region Option // [GIVEN] A JsonObject that contains the data. // [GIVEN] A Path to the value. - Path := TestFields.FieldName(OptionField); + Path := TempTestFields.FieldName(OptionField); // [GIVEN] A RecordRef of an record. // [GIVEN] A FieldNo of a OptionField field - FieldNo := TestFields.FieldNo(OptionField); + FieldNo := TempTestFields.FieldNo(OptionField); JsonHelper.GetValueIntoField(JObject, Path, RecordRef, FieldNo); // [THEN] TestField.OptionField = RecRef.Field(TestField.FieldNo(OptionField)).Value - FieldRef := RecordRef.Field(TestFields.FieldNo(OptionField)); - LibraryAssert.AreEqual(TestFields.OptionField, FieldRef.Value, Format(FieldRef.Type)); + FieldRef := RecordRef.Field(TempTestFields.FieldNo(OptionField)); + LibraryAssert.AreEqual(TempTestFields.OptionField, FieldRef.Value, Format(FieldRef.Type)); #endregion Option #region Time // [GIVEN] A JsonObject that contains the data. // [GIVEN] A Path to the value. - Path := TestFields.FieldName(TimeField); + Path := TempTestFields.FieldName(TimeField); // [GIVEN] A RecordRef of an record. // [GIVEN] A FieldNo of a TimeField field - FieldNo := TestFields.FieldNo(TimeField); + FieldNo := TempTestFields.FieldNo(TimeField); JsonHelper.GetValueIntoField(JObject, Path, RecordRef, FieldNo); // [THEN] TestField.TimeField = RecRef.Field(TestField.FieldNo(TimeField)).Value - FieldRef := RecordRef.Field(TestFields.FieldNo(TimeField)); - LibraryAssert.AreEqual(TestFields.TimeField, FieldRef.Value, Format(FieldRef.Type)); + FieldRef := RecordRef.Field(TempTestFields.FieldNo(TimeField)); + LibraryAssert.AreEqual(TempTestFields.TimeField, FieldRef.Value, Format(FieldRef.Type)); #endregion Time end; @@ -1076,8 +1076,8 @@ codeunit 139574 "Shpfy Json Helper Test" [HandlerFunctions('ValidationMessageHandler')] procedure UnitTestGetValueIntoFieldWithValidation() var - TestFields: Record "Shpfy Test Fields"; - TestFields2: Record "Shpfy Test Fields"; + TempTestFields: Record "Shpfy Test Fields"; + TempTestFields2: Record "Shpfy Test Fields"; RecordRef: RecordRef; FieldRef: FieldRef; FieldNo: Integer; @@ -1085,191 +1085,191 @@ codeunit 139574 "Shpfy Json Helper Test" Path: Text; begin // Creating Test data and expected results. - TestFields := TestFields.CreateNewRecordWithAnyValues(); - JObject.Add(TestFields.FieldName(BigIntegerField), TestFields.BigIntegerField); - JObject.Add(TestFields.FieldName(BlobField), TestFields.GetBlobData()); - JObject.Add(TestFields.FieldName(BooleanField), TestFields.BooleanField); - JObject.Add(TestFields.FieldName(CodeField), TestFields.CodeField); - JObject.Add(TestFields.FieldName(TextField), TestFields.TextField); - JObject.Add(TestFields.FieldName(DateField), TestFields.DateField); - JObject.Add(TestFields.FieldName(DateTimeField), TestFields.DateTimeField); - JObject.Add(TestFields.FieldName(DecimalField), TestFields.DecimalField); - JObject.Add(TestFields.FieldName(DurationField), TestFields.DurationField); - JObject.Add(TestFields.FieldName(GuidField), TestFields.GuidField); - JObject.Add(TestFields.FieldName(IntegerField), TestFields.IntegerField); - JObject.Add(TestFields.FieldName(OptionField), TestFields.OptionField); - JObject.Add(TestFields.FieldName(TimeField), TestFields.TimeField); + TempTestFields := TempTestFields.CreateNewRecordWithAnyValues(); + JObject.Add(TempTestFields.FieldName(BigIntegerField), TempTestFields.BigIntegerField); + JObject.Add(TempTestFields.FieldName(BlobField), TempTestFields.GetBlobData()); + JObject.Add(TempTestFields.FieldName(BooleanField), TempTestFields.BooleanField); + JObject.Add(TempTestFields.FieldName(CodeField), TempTestFields.CodeField); + JObject.Add(TempTestFields.FieldName(TextField), TempTestFields.TextField); + JObject.Add(TempTestFields.FieldName(DateField), TempTestFields.DateField); + JObject.Add(TempTestFields.FieldName(DateTimeField), TempTestFields.DateTimeField); + JObject.Add(TempTestFields.FieldName(DecimalField), TempTestFields.DecimalField); + JObject.Add(TempTestFields.FieldName(DurationField), TempTestFields.DurationField); + JObject.Add(TempTestFields.FieldName(GuidField), TempTestFields.GuidField); + JObject.Add(TempTestFields.FieldName(IntegerField), TempTestFields.IntegerField); + JObject.Add(TempTestFields.FieldName(OptionField), TempTestFields.OptionField); + JObject.Add(TempTestFields.FieldName(TimeField), TempTestFields.TimeField); RecordRef.Open(Database::"Shpfy Test Fields"); // [SCENARIO] Get values out of a Json structure and put the in to a field of a record. #region BigInteger // [GIVEN] A JsonObject that contains the data. // [GIVEN] A Path to the value. - Path := TestFields.FieldName(BigIntegerField); + Path := TempTestFields.FieldName(BigIntegerField); // [GIVEN] A RecordRef of an record. // [GIVEN] A FieldNo of a BigInteger field - FieldNo := TestFields.FieldNo(BigIntegerField); + FieldNo := TempTestFields.FieldNo(BigIntegerField); JsonHelper.GetValueIntoFieldWithValidation(JObject, Path, RecordRef, FieldNo); // [THEN] TestField.BigIntegerField = RecRef.Field(TestField.FieldNo(BigIntegerField)).Value - FieldRef := RecordRef.Field(TestFields.FieldNo(BigIntegerField)); - LibraryAssert.AreEqual(TestFields.BigIntegerField, FieldRef.Value, Format(FieldRef.Type)); + FieldRef := RecordRef.Field(TempTestFields.FieldNo(BigIntegerField)); + LibraryAssert.AreEqual(TempTestFields.BigIntegerField, FieldRef.Value, Format(FieldRef.Type)); #endregion BigInteger #region Blob // [GIVEN] A JsonObject that contains the data. // [GIVEN] A Path to the value. - Path := TestFields.FieldName(BlobField); + Path := TempTestFields.FieldName(BlobField); // [GIVEN] A RecordRef of an record. // [GIVEN] A FieldNo of a BlobField field - FieldNo := TestFields.FieldNo(BlobField); + FieldNo := TempTestFields.FieldNo(BlobField); JsonHelper.GetValueIntoFieldWithValidation(JObject, Path, RecordRef, FieldNo); // [THEN] TestField.GetBlobData() = TestField2.GetBlobData() - FieldRef := RecordRef.Field(TestFields.FieldNo(BigIntegerField)); - RecordRef.SetTable(TestFields2); - LibraryAssert.AreEqual(TestFields.GetBlobData(), TestFields2.GetBlobData(), Format(FieldRef.Type)); + FieldRef := RecordRef.Field(TempTestFields.FieldNo(BigIntegerField)); + RecordRef.SetTable(TempTestFields2); + LibraryAssert.AreEqual(TempTestFields.GetBlobData(), TempTestFields2.GetBlobData(), Format(FieldRef.Type)); #endregion #region Boolean // [GIVEN] A JsonObject that contains the data. // [GIVEN] A Path to the value. - Path := TestFields.FieldName(BooleanField); + Path := TempTestFields.FieldName(BooleanField); // [GIVEN] A RecordRef of an record. // [GIVEN] A FieldNo of a BooleanField field - FieldNo := TestFields.FieldNo(BooleanField); + FieldNo := TempTestFields.FieldNo(BooleanField); JsonHelper.GetValueIntoFieldWithValidation(JObject, Path, RecordRef, FieldNo); // [THEN] TestField.BooleanField = RecRef.Field(TestField.FieldNo(BooleanField)).Value - FieldRef := RecordRef.Field(TestFields.FieldNo(BooleanField)); - LibraryAssert.AreEqual(TestFields.BooleanField, FieldRef.Value, Format(FieldRef.Type)); + FieldRef := RecordRef.Field(TempTestFields.FieldNo(BooleanField)); + LibraryAssert.AreEqual(TempTestFields.BooleanField, FieldRef.Value, Format(FieldRef.Type)); #endregion Boolean #region Code // [GIVEN] A JsonObject that contains the data. // [GIVEN] A Path to the value. - Path := TestFields.FieldName(CodeField); + Path := TempTestFields.FieldName(CodeField); // [GIVEN] A RecordRef of an record. // [GIVEN] A FieldNo of a CodeField field - FieldNo := TestFields.FieldNo(CodeField); + FieldNo := TempTestFields.FieldNo(CodeField); JsonHelper.GetValueIntoFieldWithValidation(JObject, Path, RecordRef, FieldNo); // [THEN] TestField.CodeField = RecRef.Field(TestField.FieldNo(CodeField)).Value - FieldRef := RecordRef.Field(TestFields.FieldNo(CodeField)); - LibraryAssert.AreEqual(TestFields.CodeField, FieldRef.Value, Format(FieldRef.Type)); + FieldRef := RecordRef.Field(TempTestFields.FieldNo(CodeField)); + LibraryAssert.AreEqual(TempTestFields.CodeField, FieldRef.Value, Format(FieldRef.Type)); #endregion Code #region Text // [GIVEN] A JsonObject that contains the data. // [GIVEN] A Path to the value. - Path := TestFields.FieldName(TextField); + Path := TempTestFields.FieldName(TextField); // [GIVEN] A RecordRef of an record. // [GIVEN] A FieldNo of a TextField field - FieldNo := TestFields.FieldNo(TextField); + FieldNo := TempTestFields.FieldNo(TextField); JsonHelper.GetValueIntoFieldWithValidation(JObject, Path, RecordRef, FieldNo); // [THEN] TestField.TextField = RecRef.Field(TestField.FieldNo(TextField)).Value - FieldRef := RecordRef.Field(TestFields.FieldNo(TextField)); - LibraryAssert.AreEqual(TestFields.TextField, FieldRef.Value, Format(FieldRef.Type)); + FieldRef := RecordRef.Field(TempTestFields.FieldNo(TextField)); + LibraryAssert.AreEqual(TempTestFields.TextField, FieldRef.Value, Format(FieldRef.Type)); #endregion Text #region Date // [GIVEN] A JsonObject that contains the data. // [GIVEN] A Path to the value. - Path := TestFields.FieldName(DateField); + Path := TempTestFields.FieldName(DateField); // [GIVEN] A RecordRef of an record. // [GIVEN] A FieldNo of a DateField field - FieldNo := TestFields.FieldNo(DateField); + FieldNo := TempTestFields.FieldNo(DateField); JsonHelper.GetValueIntoFieldWithValidation(JObject, Path, RecordRef, FieldNo); // [THEN] TestField.DateField = RecRef.Field(TestField.FieldNo(DateField)).Value - FieldRef := RecordRef.Field(TestFields.FieldNo(DateField)); - LibraryAssert.AreEqual(TestFields.DateField, FieldRef.Value, Format(FieldRef.Type)); + FieldRef := RecordRef.Field(TempTestFields.FieldNo(DateField)); + LibraryAssert.AreEqual(TempTestFields.DateField, FieldRef.Value, Format(FieldRef.Type)); #endregion Date #region DateTime // [GIVEN] A JsonObject that contains the data. // [GIVEN] A Path to the value. - Path := TestFields.FieldName(DateTimeField); + Path := TempTestFields.FieldName(DateTimeField); // [GIVEN] A RecordRef of an record. // [GIVEN] A FieldNo of a DateTimeField field - FieldNo := TestFields.FieldNo(DateTimeField); + FieldNo := TempTestFields.FieldNo(DateTimeField); JsonHelper.GetValueIntoFieldWithValidation(JObject, Path, RecordRef, FieldNo); // [THEN] TestField.DateTimeField = RecRef.Field(TestField.FieldNo(DateTimeField)).Value - FieldRef := RecordRef.Field(TestFields.FieldNo(DateTimeField)); - LibraryAssert.AreEqual(TestFields.DateTimeField, FieldRef.Value, Format(FieldRef.Type)); + FieldRef := RecordRef.Field(TempTestFields.FieldNo(DateTimeField)); + LibraryAssert.AreEqual(TempTestFields.DateTimeField, FieldRef.Value, Format(FieldRef.Type)); #endregion DateTime #region Decimal // [GIVEN] A JsonObject that contains the data. // [GIVEN] A Path to the value. - Path := TestFields.FieldName(DecimalField); + Path := TempTestFields.FieldName(DecimalField); // [GIVEN] A RecordRef of an record. // [GIVEN] A FieldNo of a DecimalField field - FieldNo := TestFields.FieldNo(DecimalField); + FieldNo := TempTestFields.FieldNo(DecimalField); JsonHelper.GetValueIntoFieldWithValidation(JObject, Path, RecordRef, FieldNo); // [THEN] TestField.DecimalField = RecRef.Field(TestField.FieldNo(DecimalField)).Value - FieldRef := RecordRef.Field(TestFields.FieldNo(DecimalField)); - LibraryAssert.AreEqual(TestFields.DecimalField, FieldRef.Value, Format(FieldRef.Type)); + FieldRef := RecordRef.Field(TempTestFields.FieldNo(DecimalField)); + LibraryAssert.AreEqual(TempTestFields.DecimalField, FieldRef.Value, Format(FieldRef.Type)); #endregion Decimal #region Duration // [GIVEN] A JsonObject that contains the data. // [GIVEN] A Path to the value. - Path := TestFields.FieldName(DurationField); + Path := TempTestFields.FieldName(DurationField); // [GIVEN] A RecordRef of an record. // [GIVEN] A FieldNo of a DurationField field - FieldNo := TestFields.FieldNo(DurationField); + FieldNo := TempTestFields.FieldNo(DurationField); JsonHelper.GetValueIntoFieldWithValidation(JObject, Path, RecordRef, FieldNo); // [THEN] TestField.DurationField = RecRef.Field(TestField.FieldNo(DurationField)).Value - FieldRef := RecordRef.Field(TestFields.FieldNo(DurationField)); - LibraryAssert.AreEqual(TestFields.DurationField, FieldRef.Value, Format(FieldRef.Type)); + FieldRef := RecordRef.Field(TempTestFields.FieldNo(DurationField)); + LibraryAssert.AreEqual(TempTestFields.DurationField, FieldRef.Value, Format(FieldRef.Type)); #endregion Duration #region Guid // [GIVEN] A JsonObject that contains the data. // [GIVEN] A Path to the value. - Path := TestFields.FieldName(GuidField); + Path := TempTestFields.FieldName(GuidField); // [GIVEN] A RecordRef of an record. // [GIVEN] A FieldNo of a GuidField field - FieldNo := TestFields.FieldNo(GuidField); + FieldNo := TempTestFields.FieldNo(GuidField); JsonHelper.GetValueIntoFieldWithValidation(JObject, Path, RecordRef, FieldNo); // [THEN] TestField.GuidField = RecRef.Field(TestField.FieldNo(GuidField)).Value - FieldRef := RecordRef.Field(TestFields.FieldNo(GuidField)); - LibraryAssert.AreEqual(TestFields.GuidField, FieldRef.Value, Format(FieldRef.Type)); + FieldRef := RecordRef.Field(TempTestFields.FieldNo(GuidField)); + LibraryAssert.AreEqual(TempTestFields.GuidField, FieldRef.Value, Format(FieldRef.Type)); #endregion Guid #region Integer // [GIVEN] A JsonObject that contains the data. // [GIVEN] A Path to the value. - Path := TestFields.FieldName(IntegerField); + Path := TempTestFields.FieldName(IntegerField); // [GIVEN] A RecordRef of an record. // [GIVEN] A FieldNo of a IntegerField field - FieldNo := TestFields.FieldNo(IntegerField); + FieldNo := TempTestFields.FieldNo(IntegerField); JsonHelper.GetValueIntoFieldWithValidation(JObject, Path, RecordRef, FieldNo); // [THEN] TestField.IntegerField = RecRef.Field(TestField.FieldNo(IntegerField)).Value - FieldRef := RecordRef.Field(TestFields.FieldNo(IntegerField)); - LibraryAssert.AreEqual(TestFields.IntegerField, FieldRef.Value, Format(FieldRef.Type)); + FieldRef := RecordRef.Field(TempTestFields.FieldNo(IntegerField)); + LibraryAssert.AreEqual(TempTestFields.IntegerField, FieldRef.Value, Format(FieldRef.Type)); #endregion Integer #region Option // [GIVEN] A JsonObject that contains the data. // [GIVEN] A Path to the value. - Path := TestFields.FieldName(OptionField); + Path := TempTestFields.FieldName(OptionField); // [GIVEN] A RecordRef of an record. // [GIVEN] A FieldNo of a OptionField field - FieldNo := TestFields.FieldNo(OptionField); + FieldNo := TempTestFields.FieldNo(OptionField); JsonHelper.GetValueIntoFieldWithValidation(JObject, Path, RecordRef, FieldNo); // [THEN] TestField.OptionField = RecRef.Field(TestField.FieldNo(OptionField)).Value - FieldRef := RecordRef.Field(TestFields.FieldNo(OptionField)); - LibraryAssert.AreEqual(TestFields.OptionField, FieldRef.Value, Format(FieldRef.Type)); + FieldRef := RecordRef.Field(TempTestFields.FieldNo(OptionField)); + LibraryAssert.AreEqual(TempTestFields.OptionField, FieldRef.Value, Format(FieldRef.Type)); #endregion Option #region Time // [GIVEN] A JsonObject that contains the data. // [GIVEN] A Path to the value. - Path := TestFields.FieldName(TimeField); + Path := TempTestFields.FieldName(TimeField); // [GIVEN] A RecordRef of an record. // [GIVEN] A FieldNo of a TimeField field - FieldNo := TestFields.FieldNo(TimeField); + FieldNo := TempTestFields.FieldNo(TimeField); JsonHelper.GetValueIntoFieldWithValidation(JObject, Path, RecordRef, FieldNo); // [THEN] TestField.TimeField = RecRef.Field(TestField.FieldNo(TimeField)).Value - FieldRef := RecordRef.Field(TestFields.FieldNo(TimeField)); - LibraryAssert.AreEqual(TestFields.TimeField, FieldRef.Value, Format(FieldRef.Type)); + FieldRef := RecordRef.Field(TempTestFields.FieldNo(TimeField)); + LibraryAssert.AreEqual(TempTestFields.TimeField, FieldRef.Value, Format(FieldRef.Type)); #endregion Time end; diff --git a/src/Apps/W1/Shopify/Test/Payments/ShpfySuggestPaymentTest.Codeunit.al b/src/Apps/W1/Shopify/Test/Payments/ShpfySuggestPaymentTest.Codeunit.al index 6fbd99fc27..75fc79947a 100644 --- a/src/Apps/W1/Shopify/Test/Payments/ShpfySuggestPaymentTest.Codeunit.al +++ b/src/Apps/W1/Shopify/Test/Payments/ShpfySuggestPaymentTest.Codeunit.al @@ -33,7 +33,7 @@ codeunit 139648 "Shpfy Suggest Payment Test" Item: Record Item; Customer: Record Customer; OrderTransaction: Record "Shpfy Order Transaction"; - SuggestPayment: Record "Shpfy Suggest Payment"; + TempSuggestPayment: Record "Shpfy Suggest Payment"; SuggestPayments: Report "Shpfy Suggest Payments"; OrderId: BigInteger; Amount: Decimal; @@ -56,9 +56,9 @@ codeunit 139648 "Shpfy Suggest Payment Test" SuggestPayments.GetOrderTransactions(OrderTransaction); // [THEN] Temporary suggest payment records are created - SuggestPayments.GetTempSuggestPayment(SuggestPayment); - SuggestPayment.FindFirst(); - LibraryAssert.AreEqual(SuggestPayment.Amount, Amount, 'Amounts should match'); + SuggestPayments.GetTempSuggestPayment(TempSuggestPayment); + TempSuggestPayment.FindFirst(); + LibraryAssert.AreEqual(TempSuggestPayment.Amount, Amount, 'Amounts should match'); end; [Test] @@ -67,7 +67,7 @@ codeunit 139648 "Shpfy Suggest Payment Test" Item: Record Item; Customer: Record Customer; OrderTransaction: Record "Shpfy Order Transaction"; - SuggestPayment: Record "Shpfy Suggest Payment"; + TempSuggestPayment: Record "Shpfy Suggest Payment"; SuggestPayments: Report "Shpfy Suggest Payments"; OrderId: BigInteger; Amount: Decimal; @@ -96,14 +96,14 @@ codeunit 139648 "Shpfy Suggest Payment Test" until OrderTransaction.Next() = 0; // [THEN] Temporary suggest payment records are created - SuggestPayments.GetTempSuggestPayment(SuggestPayment); - SuggestPayment.FindSet(); + SuggestPayments.GetTempSuggestPayment(TempSuggestPayment); + TempSuggestPayment.FindSet(); repeat - if SuggestPayment.Gateway = 'manual' then - LibraryAssert.AreEqual(SuggestPayment.Amount, Amount * 0.75, 'Amounts should match'); - if SuggestPayment.Gateway = 'gift_card' then - LibraryAssert.AreEqual(SuggestPayment.Amount, Amount * 0.25, 'Amounts should match'); - until SuggestPayment.Next() = 0; + if TempSuggestPayment.Gateway = 'manual' then + LibraryAssert.AreEqual(TempSuggestPayment.Amount, Amount * 0.75, 'Amounts should match'); + if TempSuggestPayment.Gateway = 'gift_card' then + LibraryAssert.AreEqual(TempSuggestPayment.Amount, Amount * 0.25, 'Amounts should match'); + until TempSuggestPayment.Next() = 0; end; [Test] @@ -112,7 +112,7 @@ codeunit 139648 "Shpfy Suggest Payment Test" Item: Record Item; Customer: Record Customer; OrderTransaction: Record "Shpfy Order Transaction"; - SuggestPayment: Record "Shpfy Suggest Payment"; + TempSuggestPayment: Record "Shpfy Suggest Payment"; DocLinkToDoc: Record "Shpfy Doc. Link To Doc."; SuggestPayments: Report "Shpfy Suggest Payments"; OrderId1: BigInteger; @@ -155,11 +155,11 @@ codeunit 139648 "Shpfy Suggest Payment Test" until OrderTransaction.Next() = 0; // [THEN] Temporary suggest payment records are created - SuggestPayments.GetTempSuggestPayment(SuggestPayment); - SuggestPayment.FindSet(); + SuggestPayments.GetTempSuggestPayment(TempSuggestPayment); + TempSuggestPayment.FindSet(); repeat - LibraryAssert.AreEqual(SuggestPayment.Amount, Amount, 'Amounts should match'); - until SuggestPayment.Next() = 0; + LibraryAssert.AreEqual(TempSuggestPayment.Amount, Amount, 'Amounts should match'); + until TempSuggestPayment.Next() = 0; end; [HandlerFunctions('SuggestShopifyPaymentsRequestPageHandler')] @@ -257,7 +257,7 @@ codeunit 139648 "Shpfy Suggest Payment Test" Item: Record Item; Customer: Record Customer; OrderTransaction: Record "Shpfy Order Transaction"; - SuggestPayment: Record "Shpfy Suggest Payment"; + TempSuggestPayment: Record "Shpfy Suggest Payment"; SuggestPayments: Report "Shpfy Suggest Payments"; OrderId: BigInteger; RefundId: BigInteger; @@ -283,9 +283,9 @@ codeunit 139648 "Shpfy Suggest Payment Test" SuggestPayments.GetOrderTransactions(OrderTransaction); // [THEN] Temporary suggest payment records are created - SuggestPayments.GetTempSuggestPayment(SuggestPayment); - SuggestPayment.FindFirst(); - LibraryAssert.AreEqual(SuggestPayment.Amount, -Amount, 'Amounts should match'); + SuggestPayments.GetTempSuggestPayment(TempSuggestPayment); + TempSuggestPayment.FindFirst(); + LibraryAssert.AreEqual(TempSuggestPayment.Amount, -Amount, 'Amounts should match'); end; [Test] diff --git a/src/Apps/W1/SimplifiedBankStatementImport/App/src/pages/BankStatementFileWizard.Page.al b/src/Apps/W1/SimplifiedBankStatementImport/App/src/pages/BankStatementFileWizard.Page.al index eb0e448eef..5825e034fd 100644 --- a/src/Apps/W1/SimplifiedBankStatementImport/App/src/pages/BankStatementFileWizard.Page.al +++ b/src/Apps/W1/SimplifiedBankStatementImport/App/src/pages/BankStatementFileWizard.Page.al @@ -263,7 +263,7 @@ page 8850 "Bank Statement File Wizard" trigger OnValidate() var - Matches: Record Matches; + TempMatches: Record Matches; Regex: Codeunit Regex; FileLine: Text; begin @@ -273,11 +273,11 @@ page 8850 "Bank Statement File Wizard" FileLine := FileLinesList.Get(HeaderLines + 1); case ColumnSeperator of ColumnSeperator::Comma: - Regex.Match(FileLine, CommaSeperatorRegexLbl, Matches); + Regex.Match(FileLine, CommaSeperatorRegexLbl, TempMatches); ColumnSeperator::Semicolon: - Regex.Match(FileLine, SemicolonSeperatorRegexLbl, Matches); + Regex.Match(FileLine, SemicolonSeperatorRegexLbl, TempMatches); end; - ColumnCount := Matches.Count(); + ColumnCount := TempMatches.Count(); end; CurrPage.Update(false); end; @@ -524,7 +524,7 @@ page 8850 "Bank Statement File Wizard" trigger OnDrillDown() var - BankStatementImportPreview: Record "Bank Statement Import Preview"; + TempBankStatementImportPreview: Record "Bank Statement Import Preview"; BankStatementFileWizard: Codeunit "Bank Statement File Wizard"; FileUploaded2: Boolean; begin @@ -541,8 +541,8 @@ page 8850 "Bank Statement File Wizard" end; if FileUploaded or FileUploaded2 then begin - GeneratePreviewData(BankStatementImportPreview); - Page.RunModal(Page::"Bank Statement Import Preview", BankStatementImportPreview); + GeneratePreviewData(TempBankStatementImportPreview); + Page.RunModal(Page::"Bank Statement Import Preview", TempBankStatementImportPreview); end; end; } @@ -1001,9 +1001,9 @@ page 8850 "Bank Statement File Wizard" local procedure ReadBankFile() var - Matches: Record Matches; - CommaMatches: Record Matches; - SemicolonMatches: Record Matches; + TempMatches: Record Matches; + TempCommaMatches: Record Matches; + TempSemicolonMatches: Record Matches; TypeHelper: Codeunit "Type Helper"; Regex: Codeunit Regex; FileInStream: InStream; @@ -1032,13 +1032,13 @@ page 8850 "Bank Statement File Wizard" end; FileLine := FileLinesList.Get(Round(FileLinesList.Count() / 2, 1, '>')); - Regex.Match(FileLine, CommaSeperatorRegexLbl, CommaMatches); - Regex.Match(FileLine, SemicolonSeperatorRegexLbl, SemicolonMatches); + Regex.Match(FileLine, CommaSeperatorRegexLbl, TempCommaMatches); + Regex.Match(FileLine, SemicolonSeperatorRegexLbl, TempSemicolonMatches); - if CommaMatches.Count() > 2 then + if TempCommaMatches.Count() > 2 then Seperator := CommaSeperatorRegexLbl; - if SemicolonMatches.Count() > 2 then + if TempSemicolonMatches.Count() > 2 then Seperator := SemicolonSeperatorRegexLbl; if Seperator = '' then begin @@ -1048,8 +1048,8 @@ page 8850 "Bank Statement File Wizard" for LineCount := 1 to FileLinesList.Count() do begin FileLine := FileLinesList.Get(LineCount); - Regex.Match(FileLine, Seperator, Matches); - if (Matches.Count() > 2) and not HeaderLinesFound then begin + Regex.Match(FileLine, Seperator, TempMatches); + if (TempMatches.Count() > 2) and not HeaderLinesFound then begin HeaderLines := LineCount; HeaderLinesFound := true; end; @@ -1099,10 +1099,10 @@ page 8850 "Bank Statement File Wizard" local procedure RetrieveInformationFromBankFile() var - CommaMatches: Record Matches; - SemicolonMatches: Record Matches; - CurrentCommaMatches: Record Matches; - CurrentSemicolonMatches: Record Matches; + TempCommaMatches: Record Matches; + TempSemicolonMatches: Record Matches; + TempCurrentCommaMatches: Record Matches; + TempCurrentSemicolonMatches: Record Matches; Regex: Codeunit Regex; FileLine: Text; i: Integer; @@ -1111,26 +1111,26 @@ page 8850 "Bank Statement File Wizard" begin NewFileToRetrieve := false; FileLine := FileLinesList.Get(HeaderLines + 1); - Regex.Match(FileLine, CommaSeperatorRegexLbl, CommaMatches); - Regex.Match(FileLine, SemicolonSeperatorRegexLbl, SemicolonMatches); + Regex.Match(FileLine, CommaSeperatorRegexLbl, TempCommaMatches); + Regex.Match(FileLine, SemicolonSeperatorRegexLbl, TempSemicolonMatches); - if CommaMatches.Count() > 2 then + if TempCommaMatches.Count() > 2 then IsComma := true; - if SemicolonMatches.Count() > 2 then + if TempSemicolonMatches.Count() > 2 then IsSemicolon := true; for i := HeaderLines + 2 to FileLinesList.Count() do begin FileLine := FileLinesList.Get(i); if IsComma then begin - Regex.Match(FileLine, CommaSeperatorRegexLbl, CurrentCommaMatches); - if CurrentCommaMatches.Count() <> CommaMatches.Count() then + Regex.Match(FileLine, CommaSeperatorRegexLbl, TempCurrentCommaMatches); + if TempCurrentCommaMatches.Count() <> TempCommaMatches.Count() then IsComma := false; end; if IsSemicolon then begin - Regex.Match(FileLine, SemicolonSeperatorRegexLbl, CurrentSemicolonMatches); - if CurrentSemicolonMatches.Count() <> SemicolonMatches.Count() then + Regex.Match(FileLine, SemicolonSeperatorRegexLbl, TempCurrentSemicolonMatches); + if TempCurrentSemicolonMatches.Count() <> TempSemicolonMatches.Count() then IsSemicolon := false; end; @@ -1140,14 +1140,14 @@ page 8850 "Bank Statement File Wizard" if IsSemicolon then begin ColumnSeperator := ColumnSeperator::Semicolon; - ColumnCount := SemicolonMatches.Count(); + ColumnCount := TempSemicolonMatches.Count(); FillPreviewColumns(); exit; end; if IsComma then begin ColumnSeperator := ColumnSeperator::Comma; - ColumnCount := CommaMatches.Count(); + ColumnCount := TempCommaMatches.Count(); FillPreviewColumns(); exit; end; @@ -1176,7 +1176,7 @@ page 8850 "Bank Statement File Wizard" local procedure GetFormatsFromBankFile() var - Matches: Record Matches; + TempMatches: Record Matches; Regex: Codeunit Regex; FileLine: Text; CurrValue: Text; @@ -1190,19 +1190,19 @@ page 8850 "Bank Statement File Wizard" case ColumnSeperator of ColumnSeperator::Comma: begin - Regex.Match(FileLine, CommaSeperatorRegexLbl, Matches); + Regex.Match(FileLine, CommaSeperatorRegexLbl, TempMatches); SeperatorChar := ','; end; ColumnSeperator::Semicolon: begin - Regex.Match(FileLine, SemicolonSeperatorRegexLbl, Matches); + Regex.Match(FileLine, SemicolonSeperatorRegexLbl, TempMatches); SeperatorChar := ';'; end; end; if TransactionAmountColumnNo <> 0 then begin - Matches.Get(TransactionAmountColumnNo - 1); - CurrValue := Matches.ReadValue().TrimStart(SeperatorChar).TrimStart('-'); + TempMatches.Get(TransactionAmountColumnNo - 1); + CurrValue := TempMatches.ReadValue().TrimStart(SeperatorChar).TrimStart('-'); if Regex.IsMatch(CurrValue, AmountWithDotRegexLbl) and CurrValue.Contains('.') then DecimalSeperator := DecimalSeperator::Dot else @@ -1211,8 +1211,8 @@ page 8850 "Bank Statement File Wizard" end; if TransactionDateColumnNo <> 0 then begin - Matches.Get(TransactionDateColumnNo - 1); - CurrValue := Matches.ReadValue().TrimStart(SeperatorChar); + TempMatches.Get(TransactionDateColumnNo - 1); + CurrValue := TempMatches.ReadValue().TrimStart(SeperatorChar); if Regex.IsMatch(CurrValue, ddMMyyyyDashRegexLbl) then DateFormat := 'dd-MM-yyyy'; if Regex.IsMatch(CurrValue, ddMMyyyyDotRegexLbl) then @@ -1244,7 +1244,7 @@ page 8850 "Bank Statement File Wizard" local procedure GetColumnsFromBankFile() var - Matches: Record Matches; + TempMatches: Record Matches; Regex: Codeunit Regex; DateColumnNoFound: Boolean; AmountColumnNoFound: Boolean; @@ -1275,19 +1275,19 @@ page 8850 "Bank Statement File Wizard" if HeaderLines <> 0 then begin FileLine := FileLinesList.Get(HeaderLines); - Regex.Match(FileLine, SeperatorRegex, Matches); + Regex.Match(FileLine, SeperatorRegex, TempMatches); - for i := 0 to Matches.Count() - 1 do begin - Matches.Get(i); - if Matches.ReadValue().ToLower().Contains(Format(DateLbl).ToLower()) then begin + for i := 0 to TempMatches.Count() - 1 do begin + TempMatches.Get(i); + if TempMatches.ReadValue().ToLower().Contains(Format(DateLbl).ToLower()) then begin TransactionDateColumnNo := i + 1; DateColumnNoFound := true; end; - if Matches.ReadValue().ToLower().Contains(Format(AmountLbl).ToLower()) then begin + if TempMatches.ReadValue().ToLower().Contains(Format(AmountLbl).ToLower()) then begin TransactionAmountColumnNo := i + 1; AmountColumnNoFound := true; end; - if Matches.ReadValue().ToLower().Contains(Format(DescriptionLbl).ToLower()) or Matches.ReadValue().ToLower().Contains(Format(DetailLbl).ToLower()) then begin + if TempMatches.ReadValue().ToLower().Contains(Format(DescriptionLbl).ToLower()) or TempMatches.ReadValue().ToLower().Contains(Format(DetailLbl).ToLower()) then begin DescriptionColumnNo := i + 1; DescriptionColumnNoFound := true; end; @@ -1300,10 +1300,10 @@ page 8850 "Bank Statement File Wizard" if not DateColumnNoFound or not AmountColumnNoFound then for i := HeaderLines + 1 to FileLinesList.Count() do begin FileLine := FileLinesList.Get(i); - Regex.Match(FileLine, SeperatorRegex, Matches); - for j := 0 to Matches.Count() - 1 do begin - Matches.Get(j); - CurrValue := Matches.ReadValue().TrimStart(SeperatorChar); + Regex.Match(FileLine, SeperatorRegex, TempMatches); + for j := 0 to TempMatches.Count() - 1 do begin + TempMatches.Get(j); + CurrValue := TempMatches.ReadValue().TrimStart(SeperatorChar); if not DateColumnNoFound then if Regex.IsMatch(CurrValue, DateRegexLbl) or Regex.IsMatch(CurrValue, DateWithMonthNameRegexLbl) then begin @@ -1335,7 +1335,7 @@ page 8850 "Bank Statement File Wizard" local procedure FillColumnPreviews() var - Matches: Record Matches; + TempMatches: Record Matches; Regex: Codeunit Regex; TypeHelper: Codeunit "Type Helper"; FileLine: Text; @@ -1352,27 +1352,27 @@ page 8850 "Bank Statement File Wizard" case ColumnSeperator of ColumnSeperator::Comma: begin - Regex.Match(FileLine, CommaSeperatorRegexLbl, Matches); + Regex.Match(FileLine, CommaSeperatorRegexLbl, TempMatches); SeperatorChar := ','; end; ColumnSeperator::Semicolon: begin - Regex.Match(FileLine, SemicolonSeperatorRegexLbl, Matches); + Regex.Match(FileLine, SemicolonSeperatorRegexLbl, TempMatches); SeperatorChar := ';'; end; end; if TransactionDateColumnNo <> 0 then begin - Matches.Get(TransactionDateColumnNo - 1); - FilePreviewDateColumnTxt += Matches.ReadValue().TrimStart(SeperatorChar) + CRLF; + TempMatches.Get(TransactionDateColumnNo - 1); + FilePreviewDateColumnTxt += TempMatches.ReadValue().TrimStart(SeperatorChar) + CRLF; end; if TransactionAmountColumnNo <> 0 then begin - Matches.Get(TransactionAmountColumnNo - 1); - FilePreviewAmountColumnTxt += Matches.ReadValue().TrimStart(SeperatorChar) + CRLF; + TempMatches.Get(TransactionAmountColumnNo - 1); + FilePreviewAmountColumnTxt += TempMatches.ReadValue().TrimStart(SeperatorChar) + CRLF; end; if DescriptionColumnNo <> 0 then begin - Matches.Get(DescriptionColumnNo - 1); - FilePreviewDescriptionColumnTxt += Matches.ReadValue().TrimStart(SeperatorChar) + CRLF; + TempMatches.Get(DescriptionColumnNo - 1); + FilePreviewDescriptionColumnTxt += TempMatches.ReadValue().TrimStart(SeperatorChar) + CRLF; end; if i = HeaderLines + 5 then @@ -1382,7 +1382,7 @@ page 8850 "Bank Statement File Wizard" local procedure GeneratePreviewData(var BankStatementImportPreview: Record "Bank Statement Import Preview") var - Matches: Record Matches; + TempMatches: Record Matches; Regex: Codeunit Regex; FileLine: Text; AmountFormat: Text; @@ -1394,24 +1394,24 @@ page 8850 "Bank Statement File Wizard" case ColumnSeperator of ColumnSeperator::Comma: begin - Regex.Match(FileLine, CommaSeperatorRegexLbl, Matches); + Regex.Match(FileLine, CommaSeperatorRegexLbl, TempMatches); SeperatorChar := ','; end; ColumnSeperator::Semicolon: begin - Regex.Match(FileLine, SemicolonSeperatorRegexLbl, Matches); + Regex.Match(FileLine, SemicolonSeperatorRegexLbl, TempMatches); SeperatorChar := ';'; end; end; BankStatementImportPreview.Init(); BankStatementImportPreview."Primary Key" := i; - Matches.Get(TransactionAmountColumnNo - 1); - BankStatementImportPreview.Amount := CopyStr(Matches.ReadValue().TrimStart(SeperatorChar), 1, 1024); - Matches.Get(TransactionDateColumnNo - 1); - BankStatementImportPreview."Date" := CopyStr(Matches.ReadValue().TrimStart(SeperatorChar), 1, 1024); - Matches.Get(DescriptionColumnNo - 1); - BankStatementImportPreview.Description := CopyStr(Matches.ReadValue().TrimStart(SeperatorChar), 1, 1024); + TempMatches.Get(TransactionAmountColumnNo - 1); + BankStatementImportPreview.Amount := CopyStr(TempMatches.ReadValue().TrimStart(SeperatorChar), 1, 1024); + TempMatches.Get(TransactionDateColumnNo - 1); + BankStatementImportPreview."Date" := CopyStr(TempMatches.ReadValue().TrimStart(SeperatorChar), 1, 1024); + TempMatches.Get(DescriptionColumnNo - 1); + BankStatementImportPreview.Description := CopyStr(TempMatches.ReadValue().TrimStart(SeperatorChar), 1, 1024); case DecimalSeperator of DecimalSeperator::Dot: AmountFormat := 'en-US'; diff --git a/src/Apps/W1/Subscription Billing/Test/Service Commitments/ServiceCommitmentTest.Codeunit.al b/src/Apps/W1/Subscription Billing/Test/Service Commitments/ServiceCommitmentTest.Codeunit.al index f0156cc860..585a7cbcd7 100644 --- a/src/Apps/W1/Subscription Billing/Test/Service Commitments/ServiceCommitmentTest.Codeunit.al +++ b/src/Apps/W1/Subscription Billing/Test/Service Commitments/ServiceCommitmentTest.Codeunit.al @@ -483,7 +483,7 @@ codeunit 148156 "Service Commitment Test" [HandlerFunctions('ExchangeRateSelectionModalPageHandler,MessageHandler')] procedure TestOverdueServiceCommitments() var - OverdueServiceCommitments: Record "Overdue Subscription Line"; + TempOverdueServiceCommitments: Record "Overdue Subscription Line"; ServiceContractSetup: Record "Subscription Contract Setup"; i: Integer; InsertCounter: Integer; @@ -508,7 +508,7 @@ codeunit 148156 "Service Commitment Test" InsertServiceCommitment(ServiceCommitment.Partner::Vendor, InsertCounter); end; - Assert.AreEqual(InsertCounter, OverdueServiceCommitments.CountOverdueServiceCommitments(), 'Only service commitments that are open and within the correct date range should be counted.'); + Assert.AreEqual(InsertCounter, TempOverdueServiceCommitments.CountOverdueServiceCommitments(), 'Only service commitments that are open and within the correct date range should be counted.'); end; [Test] diff --git a/src/Business Foundation/App/NoSeriesCopilot/src/Copilot/NoSeriesCopilotImpl.Codeunit.al b/src/Business Foundation/App/NoSeriesCopilot/src/Copilot/NoSeriesCopilotImpl.Codeunit.al index e0ed475882..a76f8c07a8 100644 --- a/src/Business Foundation/App/NoSeriesCopilot/src/Copilot/NoSeriesCopilotImpl.Codeunit.al +++ b/src/Business Foundation/App/NoSeriesCopilot/src/Copilot/NoSeriesCopilotImpl.Codeunit.al @@ -522,9 +522,9 @@ codeunit 324 "No. Series Copilot Impl." local procedure ValidateGeneratedNoSeries(var RecRef: RecordRef) var - GeneratedNoSeries: Record "No. Series Generation Detail"; + TempGeneratedNoSeries: Record "No. Series Generation Detail"; begin - ValidateRecFieldNo(RecRef, GeneratedNoSeries.FieldNo("Is Next Year")); + ValidateRecFieldNo(RecRef, TempGeneratedNoSeries.FieldNo("Is Next Year")); RecRef.Modify(true); end; diff --git a/src/Business Foundation/App/NoSeriesCopilot/src/Copilot/NoSeriesGeneration.Page.al b/src/Business Foundation/App/NoSeriesCopilot/src/Copilot/NoSeriesGeneration.Page.al index ad226b6fed..239d650088 100644 --- a/src/Business Foundation/App/NoSeriesCopilot/src/Copilot/NoSeriesGeneration.Page.al +++ b/src/Business Foundation/App/NoSeriesCopilot/src/Copilot/NoSeriesGeneration.Page.al @@ -198,24 +198,24 @@ page 332 "No. Series Generation" local procedure GenerateNoSeries() var - GeneratedNoSeries: Record "No. Series Generation Detail"; + TempGeneratedNoSeries: Record "No. Series Generation Detail"; NoSeriesCopilotImpl: Codeunit "No. Series Copilot Impl."; begin NoSeriesCopilotTelemetry.StartDurationTracking(); - NoSeriesCopilotImpl.Generate(Rec, GeneratedNoSeries, InputText); + NoSeriesCopilotImpl.Generate(Rec, TempGeneratedNoSeries, InputText); NoSeriesCopilotTelemetry.StopDurationTracking(); - NoSeriesCopilotTelemetry.SaveTotalSuggestedLines(GeneratedNoSeries.Count()); - CurrPage.GenerationDetails.Page.Load(GeneratedNoSeries); - IsGenerationDetailsVisible := not GeneratedNoSeries.IsEmpty; + NoSeriesCopilotTelemetry.SaveTotalSuggestedLines(TempGeneratedNoSeries.Count()); + CurrPage.GenerationDetails.Page.Load(TempGeneratedNoSeries); + IsGenerationDetailsVisible := not TempGeneratedNoSeries.IsEmpty; end; local procedure ApplyGeneratedNoSeries() var - GeneratedNoSeries: Record "No. Series Generation Detail"; + TempGeneratedNoSeries: Record "No. Series Generation Detail"; NoSeriesCopilotImpl: Codeunit "No. Series Copilot Impl."; begin - CurrPage.GenerationDetails.Page.GetTempRecord(Rec."No.", GeneratedNoSeries); - NoSeriesCopilotImpl.ApplyGeneratedNoSeries(GeneratedNoSeries); - NoSeriesCopilotTelemetry.LogApply(GeneratedNoSeries); + CurrPage.GenerationDetails.Page.GetTempRecord(Rec."No.", TempGeneratedNoSeries); + NoSeriesCopilotImpl.ApplyGeneratedNoSeries(TempGeneratedNoSeries); + NoSeriesCopilotTelemetry.LogApply(TempGeneratedNoSeries); end; } \ No newline at end of file diff --git a/src/Business Foundation/Test/NoSeriesCopilot/src/NoSeriesCopilotAccuTests.Codeunit.al b/src/Business Foundation/Test/NoSeriesCopilot/src/NoSeriesCopilotAccuTests.Codeunit.al index 64a1340ae7..eb3ba57c03 100644 --- a/src/Business Foundation/Test/NoSeriesCopilot/src/NoSeriesCopilotAccuTests.Codeunit.al +++ b/src/Business Foundation/Test/NoSeriesCopilot/src/NoSeriesCopilotAccuTests.Codeunit.al @@ -24,15 +24,15 @@ codeunit 133689 "No. Series Copilot Accu. Tests" [Test] procedure NoSeriesPositiveTests(); var - NoSeriesGeneration: Record "No. Series Generation"; - NoSeriesGenerationDetail: Record "No. Series Generation Detail"; + TempNoSeriesGeneration: Record "No. Series Generation"; + TempNoSeriesGenerationDetail: Record "No. Series Generation Detail"; TestInputJsonQuestion: Codeunit "Test Input Json"; TestInputJsonAnswer: Codeunit "Test Input Json"; ExpectedNumberJson: Codeunit "Test Input Json"; Found: Boolean; begin TestInputJsonQuestion := AITTestContext.GetQuestion(); - NoSeriesCopilotTestLib.Generate(NoSeriesGeneration, NoSeriesGenerationDetail, TestInputJsonQuestion.ValueAsText()); + NoSeriesCopilotTestLib.Generate(TempNoSeriesGeneration, TempNoSeriesGenerationDetail, TestInputJsonQuestion.ValueAsText()); TestInputJsonAnswer := AITTestContext.GetExpectedData(); @@ -40,9 +40,9 @@ codeunit 133689 "No. Series Copilot Accu. Tests" if not Found then Assert.Fail('Expected "expected_number" field not found in the test input JSON answer.'); - Assert.AreNearlyEqual(ExpectedNumberJson.ValueAsInteger(), NoSeriesGenerationDetail.Count, 1.0, 'No. Series Copilot failed to generate the expected number of No. Series.'); - Assert.IsTrue(NoSeriesGenerationDetail.Count > 0, 'No. Series Copilot did not generate any No. Series, but expected some.'); + Assert.AreNearlyEqual(ExpectedNumberJson.ValueAsInteger(), TempNoSeriesGenerationDetail.Count, 1.0, 'No. Series Copilot failed to generate the expected number of No. Series.'); + Assert.IsTrue(TempNoSeriesGenerationDetail.Count > 0, 'No. Series Copilot did not generate any No. Series, but expected some.'); - AITTestContext.SetTestOutput('Test succeeded. ' + Format(NoSeriesGenerationDetail.Count) + ' new No. Series generated based on the input.'); + AITTestContext.SetTestOutput('Test succeeded. ' + Format(TempNoSeriesGenerationDetail.Count) + ' new No. Series generated based on the input.'); end; } \ No newline at end of file diff --git a/src/System Application/Test Library/MCP/src/MCPConfigTestLibrary.Codeunit.al b/src/System Application/Test Library/MCP/src/MCPConfigTestLibrary.Codeunit.al index 2c23ccda1b..2b94b536a7 100644 --- a/src/System Application/Test Library/MCP/src/MCPConfigTestLibrary.Codeunit.al +++ b/src/System Application/Test Library/MCP/src/MCPConfigTestLibrary.Codeunit.al @@ -30,18 +30,18 @@ codeunit 130131 "MCP Config Test Library" procedure LookupAPIPublisher(var APIPublisher: Text; var APIGroup: Text) var - MCPAPIPublisherGroup: Record "MCP API Publisher Group"; + TempMCPAPIPublisherGroup: Record "MCP API Publisher Group"; begin - MCPConfigImplementation.GetAPIPublishers(MCPAPIPublisherGroup); - MCPConfigImplementation.LookupAPIPublisher(MCPAPIPublisherGroup, APIPublisher, APIGroup); + MCPConfigImplementation.GetAPIPublishers(TempMCPAPIPublisherGroup); + MCPConfigImplementation.LookupAPIPublisher(TempMCPAPIPublisherGroup, APIPublisher, APIGroup); end; procedure LookupAPIGroup(APIPublisher: Text; var APIGroup: Text) var - MCPAPIPublisherGroup: Record "MCP API Publisher Group"; + TempMCPAPIPublisherGroup: Record "MCP API Publisher Group"; begin - MCPConfigImplementation.GetAPIPublishers(MCPAPIPublisherGroup); - MCPConfigImplementation.LookupAPIGroup(MCPAPIPublisherGroup, APIPublisher, APIGroup); + MCPConfigImplementation.GetAPIPublishers(TempMCPAPIPublisherGroup); + MCPConfigImplementation.LookupAPIGroup(TempMCPAPIPublisherGroup, APIPublisher, APIGroup); end; procedure GetHighestAPIVersion(PageMetadata: Record "Page Metadata"): Text[30] diff --git a/src/System Application/Test Library/Performance Profiler/src/PerfProfilerTestLibrary.Codeunit.al b/src/System Application/Test Library/Performance Profiler/src/PerfProfilerTestLibrary.Codeunit.al index ed0c6ba108..c13b823fed 100644 --- a/src/System Application/Test Library/Performance Profiler/src/PerfProfilerTestLibrary.Codeunit.al +++ b/src/System Application/Test Library/Performance Profiler/src/PerfProfilerTestLibrary.Codeunit.al @@ -29,8 +29,8 @@ codeunit 135104 "Perf. Profiler Test Library" /// procedure Initialize(PerformanceProfile: Text) var - RawProfilingNode: Record "Profiling Node"; - CallTreeProfilingNode: Record "Profiling Node"; + TempRawProfilingNode: Record "Profiling Node"; + TempCallTreeProfilingNode: Record "Profiling Node"; SamplingPerformanceProfiler: Codeunit "Sampling Performance Profiler"; TempBlob: Codeunit "Temp Blob"; SetDataInStr: InStream; @@ -41,9 +41,9 @@ codeunit 135104 "Perf. Profiler Test Library" TempBlob.CreateInStream(SetDataInStr); SamplingPerformanceProfiler.SetData(SetDataInStr); - SamplingPerformanceProfiler.GetProfilingNodes(RawProfilingNode); - SamplingPerformanceProfiler.GetProfilingCallTree(CallTreeProfilingNode); - ProfilingDataProcessor.Initialize(RawProfilingNode, CallTreeProfilingNode); + SamplingPerformanceProfiler.GetProfilingNodes(TempRawProfilingNode); + SamplingPerformanceProfiler.GetProfilingCallTree(TempCallTreeProfilingNode); + ProfilingDataProcessor.Initialize(TempRawProfilingNode, TempCallTreeProfilingNode); end; /// diff --git a/src/System Application/Test Library/Permission Sets/src/LibraryPermissionSet.codeunit.al b/src/System Application/Test Library/Permission Sets/src/LibraryPermissionSet.codeunit.al index 6a5c3cc274..2ae1ac9ab1 100644 --- a/src/System Application/Test Library/Permission Sets/src/LibraryPermissionSet.codeunit.al +++ b/src/System Application/Test Library/Permission Sets/src/LibraryPermissionSet.codeunit.al @@ -19,15 +19,15 @@ codeunit 133401 "Library Permission Set" /// Name of the permission set to open procedure OpenPermissionSetPageForPermissionSet(AppId: Guid; RoleId: Code[30]; Name: Text) var - PermissionSetBuffer: Record "PermissionSet Buffer"; + TempPermissionSetBuffer: Record "PermissionSet Buffer"; PermissionSetPage: Page "Permission Set"; begin - PermissionSetBuffer.Init(); - PermissionSetBuffer."App ID" := AppId; - PermissionSetBuffer."Role ID" := RoleId; - PermissionSetBuffer.Name := CopyStr(Name, 1, MaxStrLen(PermissionSetBuffer.Name)); - PermissionSetBuffer.Scope := PermissionSetBuffer.Scope::Tenant; - PermissionSetPage.SetRecord(PermissionSetBuffer); + TempPermissionSetBuffer.Init(); + TempPermissionSetBuffer."App ID" := AppId; + TempPermissionSetBuffer."Role ID" := RoleId; + TempPermissionSetBuffer.Name := CopyStr(Name, 1, MaxStrLen(TempPermissionSetBuffer.Name)); + TempPermissionSetBuffer.Scope := TempPermissionSetBuffer.Scope::Tenant; + PermissionSetPage.SetRecord(TempPermissionSetBuffer); PermissionSetPage.Run(); end; } \ No newline at end of file diff --git a/src/System Application/Test Library/User Details/src/UserDetailsTestLibrary.Codeunit.al b/src/System Application/Test Library/User Details/src/UserDetailsTestLibrary.Codeunit.al index 7b41530f96..a7faaaeee4 100644 --- a/src/System Application/Test Library/User Details/src/UserDetailsTestLibrary.Codeunit.al +++ b/src/System Application/Test Library/User Details/src/UserDetailsTestLibrary.Codeunit.al @@ -13,7 +13,7 @@ using System.Security.User; codeunit 132001 "User Details Test Library" { var - UserDetailsRec: Record "User Details"; + TempUserDetailsRec: Record "User Details"; UserDoesNotExistErr: Label 'The user with security ID %1 does not exist', Locked = true; /// @@ -23,7 +23,7 @@ codeunit 132001 "User Details Test Library" var UserDetails: Codeunit "User Details"; begin - UserDetails.Get(UserDetailsRec); + UserDetails.Get(TempUserDetailsRec); end; /// @@ -32,11 +32,11 @@ codeunit 132001 "User Details Test Library" /// The user security ID procedure HasSuperPermissionSet(UserSID: Guid): Boolean begin - if not UserDetailsRec.Get(UserSID) then + if not TempUserDetailsRec.Get(UserSID) then Error(UserDoesNotExistErr, UserSID); - UserDetailsRec.CalcFields("Has SUPER permission set"); - exit(UserDetailsRec."Has SUPER permission set"); + TempUserDetailsRec.CalcFields("Has SUPER permission set"); + exit(TempUserDetailsRec."Has SUPER permission set"); end; /// @@ -45,10 +45,10 @@ codeunit 132001 "User Details Test Library" /// The user security ID procedure UserPlans(UserSID: Guid): Text begin - if not UserDetailsRec.Get(UserSID) then + if not TempUserDetailsRec.Get(UserSID) then Error(UserDoesNotExistErr, UserSID); - exit(UserDetailsRec."User Plans"); + exit(TempUserDetailsRec."User Plans"); end; /// @@ -57,10 +57,10 @@ codeunit 132001 "User Details Test Library" /// The user security ID procedure IsDelegated(UserSID: Guid): Boolean begin - if not UserDetailsRec.Get(UserSID) then + if not TempUserDetailsRec.Get(UserSID) then Error(UserDoesNotExistErr, UserSID); - exit(UserDetailsRec."Is Delegated"); + exit(TempUserDetailsRec."Is Delegated"); end; /// @@ -69,10 +69,10 @@ codeunit 132001 "User Details Test Library" /// The user security ID procedure HasM365Plan(UserSID: Guid): Boolean begin - if not UserDetailsRec.Get(UserSID) then + if not TempUserDetailsRec.Get(UserSID) then Error(UserDoesNotExistErr, UserSID); - exit(UserDetailsRec."Has M365 Plan"); + exit(TempUserDetailsRec."Has M365 Plan"); end; /// @@ -81,10 +81,10 @@ codeunit 132001 "User Details Test Library" /// The user security ID procedure HasEssentialPlan(UserSID: Guid): Boolean begin - if not UserDetailsRec.Get(UserSID) then + if not TempUserDetailsRec.Get(UserSID) then Error(UserDoesNotExistErr, UserSID); - exit(UserDetailsRec."Has Essential Plan"); + exit(TempUserDetailsRec."Has Essential Plan"); end; /// @@ -93,10 +93,10 @@ codeunit 132001 "User Details Test Library" /// The user security ID procedure HasPremiumPlan(UserSID: Guid): Boolean begin - if not UserDetailsRec.Get(UserSID) then + if not TempUserDetailsRec.Get(UserSID) then Error(UserDoesNotExistErr, UserSID); - exit(UserDetailsRec."Has Premium Plan"); + exit(TempUserDetailsRec."Has Premium Plan"); end; /// @@ -105,9 +105,9 @@ codeunit 132001 "User Details Test Library" /// The user security ID procedure HasEssentialOrPremiumPlan(UserSID: Guid): Boolean begin - if not UserDetailsRec.Get(UserSID) then + if not TempUserDetailsRec.Get(UserSID) then Error(UserDoesNotExistErr, UserSID); - exit(UserDetailsRec."Has Essential Or Premium Plan"); + exit(TempUserDetailsRec."Has Essential Or Premium Plan"); end; } \ No newline at end of file diff --git a/src/System Application/Test/Azure AD Plan/src/PlanConfigurationTest.Codeunit.al b/src/System Application/Test/Azure AD Plan/src/PlanConfigurationTest.Codeunit.al index 8e4f5d649a..2276e3ae1d 100644 --- a/src/System Application/Test/Azure AD Plan/src/PlanConfigurationTest.Codeunit.al +++ b/src/System Application/Test/Azure AD Plan/src/PlanConfigurationTest.Codeunit.al @@ -28,18 +28,18 @@ codeunit 132931 "Plan Configuration Test" [CommitBehavior(CommitBehavior::Ignore)] procedure TestAddDefaultPermissionSetToPlan() var - PermissionSetInPlanBuffer: Record "Permission Set In Plan Buffer"; + TempPermissionSetInPlanBuffer: Record "Permission Set In Plan Buffer"; begin // [WHEN] A default permission set is added to a new plan PlanConfiguration.AddDefaultPermissionSetToPlan(TestPlanIdTxt, TestRoleIdTxt, NullGuid, Scope::Tenant); // [THEN] The permission set can be retrieved by calling GetDefaultPermissions - PlanConfiguration.GetDefaultPermissions(PermissionSetInPlanBuffer); - PermissionSetInPlanBuffer.SetRange("Plan ID", TestPlanIdTxt); - Assert.RecordCount(PermissionSetInPlanBuffer, 1); + PlanConfiguration.GetDefaultPermissions(TempPermissionSetInPlanBuffer); + TempPermissionSetInPlanBuffer.SetRange("Plan ID", TestPlanIdTxt); + Assert.RecordCount(TempPermissionSetInPlanBuffer, 1); - PermissionSetInPlanBuffer.FindFirst(); - Assert.AreEqual(TestRoleIdTxt, PermissionSetInPlanBuffer."Role ID", 'Unexpected permission set name.'); + TempPermissionSetInPlanBuffer.FindFirst(); + Assert.AreEqual(TestRoleIdTxt, TempPermissionSetInPlanBuffer."Role ID", 'Unexpected permission set name.'); end; [Test] @@ -47,20 +47,20 @@ codeunit 132931 "Plan Configuration Test" [CommitBehavior(CommitBehavior::Ignore)] procedure TestAddCustomPermissionSetToPlan() var - PermissionSetInPlanBuffer: Record "Permission Set In Plan Buffer"; + TempPermissionSetInPlanBuffer: Record "Permission Set In Plan Buffer"; begin // [WHEN] A custom permission set is added to a new plan PlanConfiguration.AddCustomPermissionSetToPlan(TestPlanIdTxt, TestRoleIdTxt, NullGuid, Scope::Tenant, TestCompanyNameTxt); // [THEN] The permission set can be retrieved by calling GetDefaultPermissions - PlanConfiguration.GetCustomPermissions(PermissionSetInPlanBuffer); - PermissionSetInPlanBuffer.SetRange("Plan ID", TestPlanIdTxt); - Assert.RecordCount(PermissionSetInPlanBuffer, 1); + PlanConfiguration.GetCustomPermissions(TempPermissionSetInPlanBuffer); + TempPermissionSetInPlanBuffer.SetRange("Plan ID", TestPlanIdTxt); + Assert.RecordCount(TempPermissionSetInPlanBuffer, 1); - PermissionSetInPlanBuffer.FindFirst(); - Assert.AreEqual(TestRoleIdTxt, PermissionSetInPlanBuffer."Role ID", 'Unexpected permission set name.'); + TempPermissionSetInPlanBuffer.FindFirst(); + Assert.AreEqual(TestRoleIdTxt, TempPermissionSetInPlanBuffer."Role ID", 'Unexpected permission set name.'); // Custom configurations store the company name. Verify that it is as expected - Assert.AreEqual(TestCompanyNameTxt, PermissionSetInPlanBuffer."Company Name", 'Unexpected company name.'); + Assert.AreEqual(TestCompanyNameTxt, TempPermissionSetInPlanBuffer."Company Name", 'Unexpected company name.'); end; [Test] @@ -68,7 +68,7 @@ codeunit 132931 "Plan Configuration Test" [CommitBehavior(CommitBehavior::Ignore)] procedure TestRemoveDefaultPermissionSetFromPlan() var - PermissionSetInPlanBuffer: Record "Permission Set In Plan Buffer"; + TempPermissionSetInPlanBuffer: Record "Permission Set In Plan Buffer"; begin // [GIVEN] A default permission set is added to a new plan PlanConfiguration.AddDefaultPermissionSetToPlan(TestPlanIdTxt, TestRoleIdTxt, NullGuid, Scope::Tenant); @@ -77,9 +77,9 @@ codeunit 132931 "Plan Configuration Test" PlanConfiguration.RemoveDefaultPermissionSetFromPlan(TestPlanIdTxt, TestRoleIdTxt, NullGuid, Scope::Tenant); // [THEN] The permission set cannot be retrieved by getting default permissions - PlanConfiguration.GetDefaultPermissions(PermissionSetInPlanBuffer); - PermissionSetInPlanBuffer.SetRange("Plan ID", TestPlanIdTxt); - Assert.RecordIsEmpty(PermissionSetInPlanBuffer); + PlanConfiguration.GetDefaultPermissions(TempPermissionSetInPlanBuffer); + TempPermissionSetInPlanBuffer.SetRange("Plan ID", TestPlanIdTxt); + Assert.RecordIsEmpty(TempPermissionSetInPlanBuffer); end; [Test] @@ -87,7 +87,7 @@ codeunit 132931 "Plan Configuration Test" [CommitBehavior(CommitBehavior::Ignore)] procedure TestRemoveCustomPermissionSetFromPlan() var - PermissionSetInPlanBuffer: Record "Permission Set In Plan Buffer"; + TempPermissionSetInPlanBuffer: Record "Permission Set In Plan Buffer"; begin // [GIVEN] A custom permission set is added to a new plan PlanConfiguration.AddCustomPermissionSetToPlan(TestPlanIdTxt, TestRoleIdTxt, NullGuid, Scope::Tenant, TestCompanyNameTxt); @@ -96,9 +96,9 @@ codeunit 132931 "Plan Configuration Test" PlanConfiguration.RemoveCustomPermissionSetFromPlan(TestPlanIdTxt, TestRoleIdTxt, NullGuid, Scope::Tenant, TestCompanyNameTxt); // [THEN] The permission set cannot be retrieved by getting custom permissions - PlanConfiguration.GetCustomPermissions(PermissionSetInPlanBuffer); - PermissionSetInPlanBuffer.SetRange("Plan ID", TestPlanIdTxt); - Assert.RecordIsEmpty(PermissionSetInPlanBuffer); + PlanConfiguration.GetCustomPermissions(TempPermissionSetInPlanBuffer); + TempPermissionSetInPlanBuffer.SetRange("Plan ID", TestPlanIdTxt); + Assert.RecordIsEmpty(TempPermissionSetInPlanBuffer); end; [Test] diff --git a/src/System Application/Test/Azure AD User Management/src/AzureADUserSyncTest.Codeunit.al b/src/System Application/Test/Azure AD User Management/src/AzureADUserSyncTest.Codeunit.al index ea44e7054f..32ac0500ec 100644 --- a/src/System Application/Test/Azure AD User Management/src/AzureADUserSyncTest.Codeunit.al +++ b/src/System Application/Test/Azure AD User Management/src/AzureADUserSyncTest.Codeunit.al @@ -720,7 +720,7 @@ codeunit 132928 "Azure AD User Sync Test" procedure TestArePermissionsCustomizedNo() var User: Record User; - AzureADUserUpdateBuffer: Record "Azure AD User Update Buffer"; + TempAzureADUserUpdateBuffer: Record "Azure AD User Update Buffer"; AzureADPlanTestLibrary: Codeunit "Azure AD Plan Test Library"; PlanConfiguration: Codeunit "Plan Configuration"; AzureADUserSyncImpl: Codeunit "Azure AD User Sync Impl."; @@ -740,8 +740,8 @@ codeunit 132928 "Azure AD User Sync Test" MockGraphQueryTestLibrary.AddUserPlan(GraphUser.ObjectId, TestPlanId, '', 'Enabled'); // [WHEN] The information from M365 is fetched and applied - AzureADUserSyncImpl.FetchUpdatesFromAzureGraph(AzureADUserUpdateBuffer); - AzureADUserSyncImpl.ApplyUpdatesFromAzureGraph(AzureADUserUpdateBuffer); + AzureADUserSyncImpl.FetchUpdatesFromAzureGraph(TempAzureADUserUpdateBuffer); + AzureADUserSyncImpl.ApplyUpdatesFromAzureGraph(TempAzureADUserUpdateBuffer); User.SetRange("Authentication Email", NonBcEmailTxt); LibraryAssert.IsTrue(User.FindFirst(), UserWasNotCreatedErr); @@ -762,7 +762,7 @@ codeunit 132928 "Azure AD User Sync Test" procedure TestArePermissionsCustomizedYes() var User: Record User; - AzureADUserUpdateBuffer: Record "Azure AD User Update Buffer"; + TempAzureADUserUpdateBuffer: Record "Azure AD User Update Buffer"; AccessControl: Record "Access Control"; AzureADPlanTestLibrary: Codeunit "Azure AD Plan Test Library"; PlanConfiguration: Codeunit "Plan Configuration"; @@ -783,8 +783,8 @@ codeunit 132928 "Azure AD User Sync Test" MockGraphQueryTestLibrary.AddUserPlan(GraphUser.ObjectId, TestPlanId, '', 'Enabled'); // [GIVEN] The information from M365 is fetched and applied - AzureADUserSyncImpl.FetchUpdatesFromAzureGraph(AzureADUserUpdateBuffer); - AzureADUserSyncImpl.ApplyUpdatesFromAzureGraph(AzureADUserUpdateBuffer); + AzureADUserSyncImpl.FetchUpdatesFromAzureGraph(TempAzureADUserUpdateBuffer); + AzureADUserSyncImpl.ApplyUpdatesFromAzureGraph(TempAzureADUserUpdateBuffer); User.SetRange("Authentication Email", NonBcEmailTxt); LibraryAssert.IsTrue(User.FindFirst(), UserWasNotCreatedErr); diff --git a/src/System Application/Test/Azure Blob Services API/src/ABSBlobClientTest.Codeunit.al b/src/System Application/Test/Azure Blob Services API/src/ABSBlobClientTest.Codeunit.al index da64764f9f..1890644a03 100644 --- a/src/System Application/Test/Azure Blob Services API/src/ABSBlobClientTest.Codeunit.al +++ b/src/System Application/Test/Azure Blob Services API/src/ABSBlobClientTest.Codeunit.al @@ -118,7 +118,7 @@ codeunit 132920 "ABS Blob Client Test" [Test] procedure ListBlobsTest() var - ABSContainerContent: Record "ABS Container Content"; + TempABSContainerContent: Record "ABS Container Content"; Response: Codeunit "ABS Operation Response"; ContainerName, FirstBlobName, SecondBlobName, BlobContent : Text; begin @@ -143,19 +143,19 @@ codeunit 132920 "ABS Blob Client Test" Response := ABSBlobClient.PutBlobBlockBlobText(FirstBlobName, BlobContent); Assert.IsTrue(Response.IsSuccessful(), 'Adding the first BLOB failed'); - ABSBlobClient.ListBlobs(ABSContainerContent); - Assert.AreEqual(1, ABSContainerContent.Count(), 'There should be exactly one BLOB in the container'); + ABSBlobClient.ListBlobs(TempABSContainerContent); + Assert.AreEqual(1, TempABSContainerContent.Count(), 'There should be exactly one BLOB in the container'); - Assert.AreEqual('BlockBlob', ABSContainerContent."Blob Type", 'Wrong BLOB type'); - Assert.AreNotEqual(0, ABSContainerContent."Content Length", 'Content Length should not be 0'); - Assert.AreEqual('text/plain; charset=utf-8', ABSContainerContent."Content Type", 'Wrong Content type'); + Assert.AreEqual('BlockBlob', TempABSContainerContent."Blob Type", 'Wrong BLOB type'); + Assert.AreNotEqual(0, TempABSContainerContent."Content Length", 'Content Length should not be 0'); + Assert.AreEqual('text/plain; charset=utf-8', TempABSContainerContent."Content Type", 'Wrong Content type'); // Add another BLOB block Response := ABSBlobClient.PutBlobBlockBlobText(SecondBlobName, BlobContent); Assert.IsTrue(Response.IsSuccessful(), 'Adding the second BLOB failed'); - ABSBlobClient.ListBlobs(ABSContainerContent); - Assert.AreEqual(2, ABSContainerContent.Count(), 'There should be two BLOBs in the container'); + ABSBlobClient.ListBlobs(TempABSContainerContent); + Assert.AreEqual(2, TempABSContainerContent.Count(), 'There should be two BLOBs in the container'); // Clean-up ABSContainerClient.DeleteContainer(ContainerName); @@ -266,7 +266,7 @@ codeunit 132920 "ABS Blob Client Test" [Test] procedure ListBlobHierarchyTest() var - ABSContainerContent: Record "ABS Container Content"; + TempABSContainerContent: Record "ABS Container Content"; ContainerName: Text; begin // [Scenario] When listing blobs, the levels, parent directories etc. are set correctly @@ -318,137 +318,137 @@ codeunit 132920 "ABS Blob Client Test" // [When] Listing the BLOBs in the container // [Then] The result is as expected - Assert.IsTrue(ABSBlobClient.ListBlobs(ABSContainerContent).IsSuccessful(), 'Operation ListBlobs failed'); - Assert.AreEqual(15, ABSContainerContent.Count(), 'Wrong number of BLOBs + directories'); + Assert.IsTrue(ABSBlobClient.ListBlobs(TempABSContainerContent).IsSuccessful(), 'Operation ListBlobs failed'); + Assert.AreEqual(15, TempABSContainerContent.Count(), 'Wrong number of BLOBs + directories'); // [Then] Directory entries are created - ABSContainerContent.SetRange("Content Type", 'Directory'); - Assert.AreEqual(5, ABSContainerContent.Count(), 'There should be 5 directories in the result'); - - ABSContainerContent.Reset(); - - // [Then] Enties in the result (ABSContainerContent) are ordered by EntryNo and the BLOBs are sorted alphabetical order (by full name) - Assert.IsTrue(ABSContainerContent.FindSet(), 'Directory does not exist'); - Assert.AreEqual('folder1', ABSContainerContent.Name, 'Wrong name'); - Assert.AreEqual('folder1', ABSContainerContent."Full Name", 'Wrong full name'); - Assert.AreEqual('', ABSContainerContent."Parent Directory", 'Wrong parent directory'); - Assert.AreEqual('', ABSContainerContent."Blob Type", 'Wrong BLOB type'); - Assert.AreEqual('Directory', ABSContainerContent."Content Type", 'Wrong content type'); - Assert.AreEqual(0, ABSContainerContent.Level, 'Wrong level'); - - Assert.IsTrue(ABSContainerContent.Next() <> 0, 'BLOB does not exist'); - Assert.AreEqual('folderblob1', ABSContainerContent.Name, 'Wrong name'); - Assert.AreEqual('folder1/folderblob1', ABSContainerContent."Full Name", 'Wrong full name'); - Assert.AreEqual('folder1/', ABSContainerContent."Parent Directory", 'Wrong parent directory'); - Assert.AreNotEqual('', ABSContainerContent."Blob Type", 'Wrong BLOB type'); - Assert.AreNotEqual('Directory', ABSContainerContent."Content Type", 'Wrong content type'); - Assert.AreEqual(1, ABSContainerContent.Level, 'Wrong BLOB level'); - - Assert.IsTrue(ABSContainerContent.Next() <> 0, 'BLOB does not exist'); - Assert.AreEqual('folderblob2', ABSContainerContent.Name, 'Wrong name'); - Assert.AreEqual('folder1/folderblob2', ABSContainerContent."Full Name", 'Wrong full name'); - Assert.AreEqual('folder1/', ABSContainerContent."Parent Directory", 'Wrong parent directory'); - Assert.AreNotEqual('', ABSContainerContent."Blob Type", 'Wrong BLOB type'); - Assert.AreNotEqual('Directory', ABSContainerContent."Content Type", 'Wrong content type'); - Assert.AreEqual(1, ABSContainerContent.Level, 'Wrong BLOB level'); - - Assert.IsTrue(ABSContainerContent.Next() <> 0, 'Directory does not exist'); - Assert.AreEqual('subfolder1', ABSContainerContent.Name, 'Wrong name'); - Assert.AreEqual('folder1/subfolder1', ABSContainerContent."Full Name", 'Wrong full name'); - Assert.AreEqual('folder1/', ABSContainerContent."Parent Directory", 'Wrong parent directory'); - Assert.AreEqual('', ABSContainerContent."Blob Type", 'Wrong BLOB type'); - Assert.AreEqual('Directory', ABSContainerContent."Content Type", 'Wrong content type'); - Assert.AreEqual(1, ABSContainerContent.Level, 'Wrong level'); - - Assert.IsTrue(ABSContainerContent.Next() <> 0, 'BLOB does not exist'); - Assert.AreEqual('subfolderblob1', ABSContainerContent.Name, 'Wrong name'); - Assert.AreEqual('folder1/subfolder1/subfolderblob1', ABSContainerContent."Full Name", 'Wrong full name'); - Assert.AreEqual('folder1/subfolder1/', ABSContainerContent."Parent Directory", 'Wrong parent directory'); - Assert.AreNotEqual('', ABSContainerContent."Blob Type", 'Wrong BLOB type'); - Assert.AreNotEqual('Directory', ABSContainerContent."Content Type", 'Wrong content type'); - Assert.AreEqual(2, ABSContainerContent.Level, 'Wrong BLOB level'); - - Assert.IsTrue(ABSContainerContent.Next() <> 0, 'BLOB does not exist'); - Assert.AreEqual('subfolderblob2', ABSContainerContent.Name, 'Wrong name'); - Assert.AreEqual('folder1/subfolder1/subfolderblob2', ABSContainerContent."Full Name", 'Wrong full name'); - Assert.AreEqual('folder1/subfolder1/', ABSContainerContent."Parent Directory", 'Wrong parent directory'); - Assert.AreNotEqual('', ABSContainerContent."Blob Type", 'Wrong BLOB type'); - Assert.AreNotEqual('Directory', ABSContainerContent."Content Type", 'Wrong content type'); - Assert.AreEqual(2, ABSContainerContent.Level, 'Wrong BLOB level'); - - Assert.IsTrue(ABSContainerContent.Next() <> 0, 'Directory does not exist'); - Assert.AreEqual('subsubfolder', ABSContainerContent.Name, 'Wrong name'); - Assert.AreEqual('folder1/subfolder1/subsubfolder', ABSContainerContent."Full Name", 'Wrong full name'); - Assert.AreEqual('folder1/subfolder1/', ABSContainerContent."Parent Directory", 'Wrong parent directory'); - Assert.AreEqual('Directory', ABSContainerContent."Content Type", 'Wrong content type'); - Assert.AreEqual('', ABSContainerContent."Blob Type", 'Wrong BLOB type'); - Assert.AreEqual(2, ABSContainerContent.Level, 'Wrong level'); - - Assert.IsTrue(ABSContainerContent.Next() <> 0, 'BLOB does not exist'); - Assert.AreEqual('subsubfolderblob1', ABSContainerContent.Name, 'Wrong name'); - Assert.AreEqual('folder1/subfolder1/subsubfolder/subsubfolderblob1', ABSContainerContent."Full Name", 'Wrong full name'); - Assert.AreEqual('folder1/subfolder1/subsubfolder/', ABSContainerContent."Parent Directory", 'Wrong parent directory'); - Assert.AreNotEqual('', ABSContainerContent."Blob Type", 'Wrong BLOB type'); - Assert.AreNotEqual('Directory', ABSContainerContent."Content Type", 'Wrong content type'); - Assert.AreEqual(3, ABSContainerContent.Level, 'Wrong BLOB level'); - - Assert.IsTrue(ABSContainerContent.Next() <> 0, 'BLOB does not exist'); - Assert.AreEqual('subsubfolderblob2', ABSContainerContent.Name, 'Wrong name'); - Assert.AreEqual('folder1/subfolder1/subsubfolder/subsubfolderblob2', ABSContainerContent."Full Name", 'Wrong full name'); - Assert.AreEqual('folder1/subfolder1/subsubfolder/', ABSContainerContent."Parent Directory", 'Wrong parent directory'); - Assert.AreNotEqual('Directory', ABSContainerContent."Content Type", 'Wrong content type'); - Assert.AreNotEqual('', ABSContainerContent."Blob Type", 'Wrong BLOB type'); - Assert.AreEqual(3, ABSContainerContent.Level, 'Wrong BLOB level'); - - Assert.IsTrue(ABSContainerContent.Next() <> 0, 'Directory does not exist'); - Assert.AreEqual('subfolder2', ABSContainerContent.Name, 'Wrong name'); - Assert.AreEqual('folder1/subfolder2', ABSContainerContent."Full Name", 'Wrong full name'); - Assert.AreEqual('folder1/', ABSContainerContent."Parent Directory", 'Wrong parent directory'); - Assert.AreEqual('', ABSContainerContent."Blob Type", 'Wrong BLOB type'); - Assert.AreEqual('Directory', ABSContainerContent."Content Type", 'Wrong content type'); - Assert.AreEqual(1, ABSContainerContent.Level, 'Wrong level'); - - Assert.IsTrue(ABSContainerContent.Next() <> 0, 'Directory does not exist'); - Assert.AreEqual('subsubfolder', ABSContainerContent.Name, 'Wrong name'); - Assert.AreEqual('folder1/subfolder2/subsubfolder', ABSContainerContent."Full Name", 'Wrong full name'); - Assert.AreEqual('folder1/subfolder2/', ABSContainerContent."Parent Directory", 'Wrong parent directory'); - Assert.AreEqual('Directory', ABSContainerContent."Content Type", 'Wrong content type'); - Assert.AreEqual('', ABSContainerContent."Blob Type", 'Wrong BLOB type'); - Assert.AreEqual(2, ABSContainerContent.Level, 'Wrong level'); - - Assert.IsTrue(ABSContainerContent.Next() <> 0, 'BLOB does not exist'); - Assert.AreEqual('subsubfolderblob1', ABSContainerContent.Name, 'Wrong name'); - Assert.AreEqual('folder1/subfolder2/subsubfolder/subsubfolderblob1', ABSContainerContent."Full Name", 'Wrong full name'); - Assert.AreEqual('folder1/subfolder2/subsubfolder/', ABSContainerContent."Parent Directory", 'Wrong parent directory'); - Assert.AreNotEqual('', ABSContainerContent."Blob Type", 'Wrong BLOB type'); - Assert.AreNotEqual('Directory', ABSContainerContent."Content Type", 'Wrong content type'); - Assert.AreEqual(3, ABSContainerContent.Level, 'Wrong BLOB level'); - - Assert.IsTrue(ABSContainerContent.Next() <> 0, 'BLOB does not exist'); - Assert.AreEqual('subsubfolderblob2', ABSContainerContent.Name, 'Wrong name'); - Assert.AreEqual('folder1/subfolder2/subsubfolder/subsubfolderblob2', ABSContainerContent."Full Name", 'Wrong full name'); - Assert.AreEqual('folder1/subfolder2/subsubfolder/', ABSContainerContent."Parent Directory", 'Wrong parent directory'); - Assert.AreNotEqual('Directory', ABSContainerContent."Content Type", 'Wrong content type'); - Assert.AreNotEqual('', ABSContainerContent."Blob Type", 'Wrong BLOB type'); - Assert.AreEqual(3, ABSContainerContent.Level, 'Wrong BLOB level'); - - Assert.IsTrue(ABSContainerContent.Next() <> 0, 'BLOB does not exist'); - Assert.AreEqual('rootblob1', ABSContainerContent.Name, 'Wrong name'); - Assert.AreEqual('rootblob1', ABSContainerContent."Full Name", 'Wrong full name'); - Assert.AreEqual('', ABSContainerContent."Parent Directory", 'Wrong parent directory'); - Assert.AreNotEqual('Directory', ABSContainerContent."Content Type", 'Wrong content type'); - Assert.AreNotEqual('', ABSContainerContent."Blob Type", 'Wrong BLOB type'); - Assert.AreEqual(0, ABSContainerContent.Level, 'Wrong BLOB level'); - - Assert.IsTrue(ABSContainerContent.Next() <> 0, 'BLOB does not exist'); - Assert.AreEqual('rootblob2', ABSContainerContent.Name, 'Wrong name'); - Assert.AreEqual('rootblob2', ABSContainerContent."Full Name", 'Wrong full name'); - Assert.AreEqual('', ABSContainerContent."Parent Directory", 'Wrong parent directory'); - Assert.AreNotEqual('Directory', ABSContainerContent."Content Type", 'Wrong content type'); - Assert.AreNotEqual('', ABSContainerContent."Blob Type", 'Wrong BLOB type'); - Assert.AreEqual(0, ABSContainerContent.Level, 'Wrong BLOB level'); - - Assert.IsTrue(ABSContainerContent.Next() = 0, 'There should be no more entries'); + TempABSContainerContent.SetRange("Content Type", 'Directory'); + Assert.AreEqual(5, TempABSContainerContent.Count(), 'There should be 5 directories in the result'); + + TempABSContainerContent.Reset(); + + // [Then] Enties in the result (TempABSContainerContent) are ordered by EntryNo and the BLOBs are sorted alphabetical order (by full name) + Assert.IsTrue(TempABSContainerContent.FindSet(), 'Directory does not exist'); + Assert.AreEqual('folder1', TempABSContainerContent.Name, 'Wrong name'); + Assert.AreEqual('folder1', TempABSContainerContent."Full Name", 'Wrong full name'); + Assert.AreEqual('', TempABSContainerContent."Parent Directory", 'Wrong parent directory'); + Assert.AreEqual('', TempABSContainerContent."Blob Type", 'Wrong BLOB type'); + Assert.AreEqual('Directory', TempABSContainerContent."Content Type", 'Wrong content type'); + Assert.AreEqual(0, TempABSContainerContent.Level, 'Wrong level'); + + Assert.IsTrue(TempABSContainerContent.Next() <> 0, 'BLOB does not exist'); + Assert.AreEqual('folderblob1', TempABSContainerContent.Name, 'Wrong name'); + Assert.AreEqual('folder1/folderblob1', TempABSContainerContent."Full Name", 'Wrong full name'); + Assert.AreEqual('folder1/', TempABSContainerContent."Parent Directory", 'Wrong parent directory'); + Assert.AreNotEqual('', TempABSContainerContent."Blob Type", 'Wrong BLOB type'); + Assert.AreNotEqual('Directory', TempABSContainerContent."Content Type", 'Wrong content type'); + Assert.AreEqual(1, TempABSContainerContent.Level, 'Wrong BLOB level'); + + Assert.IsTrue(TempABSContainerContent.Next() <> 0, 'BLOB does not exist'); + Assert.AreEqual('folderblob2', TempABSContainerContent.Name, 'Wrong name'); + Assert.AreEqual('folder1/folderblob2', TempABSContainerContent."Full Name", 'Wrong full name'); + Assert.AreEqual('folder1/', TempABSContainerContent."Parent Directory", 'Wrong parent directory'); + Assert.AreNotEqual('', TempABSContainerContent."Blob Type", 'Wrong BLOB type'); + Assert.AreNotEqual('Directory', TempABSContainerContent."Content Type", 'Wrong content type'); + Assert.AreEqual(1, TempABSContainerContent.Level, 'Wrong BLOB level'); + + Assert.IsTrue(TempABSContainerContent.Next() <> 0, 'Directory does not exist'); + Assert.AreEqual('subfolder1', TempABSContainerContent.Name, 'Wrong name'); + Assert.AreEqual('folder1/subfolder1', TempABSContainerContent."Full Name", 'Wrong full name'); + Assert.AreEqual('folder1/', TempABSContainerContent."Parent Directory", 'Wrong parent directory'); + Assert.AreEqual('', TempABSContainerContent."Blob Type", 'Wrong BLOB type'); + Assert.AreEqual('Directory', TempABSContainerContent."Content Type", 'Wrong content type'); + Assert.AreEqual(1, TempABSContainerContent.Level, 'Wrong level'); + + Assert.IsTrue(TempABSContainerContent.Next() <> 0, 'BLOB does not exist'); + Assert.AreEqual('subfolderblob1', TempABSContainerContent.Name, 'Wrong name'); + Assert.AreEqual('folder1/subfolder1/subfolderblob1', TempABSContainerContent."Full Name", 'Wrong full name'); + Assert.AreEqual('folder1/subfolder1/', TempABSContainerContent."Parent Directory", 'Wrong parent directory'); + Assert.AreNotEqual('', TempABSContainerContent."Blob Type", 'Wrong BLOB type'); + Assert.AreNotEqual('Directory', TempABSContainerContent."Content Type", 'Wrong content type'); + Assert.AreEqual(2, TempABSContainerContent.Level, 'Wrong BLOB level'); + + Assert.IsTrue(TempABSContainerContent.Next() <> 0, 'BLOB does not exist'); + Assert.AreEqual('subfolderblob2', TempABSContainerContent.Name, 'Wrong name'); + Assert.AreEqual('folder1/subfolder1/subfolderblob2', TempABSContainerContent."Full Name", 'Wrong full name'); + Assert.AreEqual('folder1/subfolder1/', TempABSContainerContent."Parent Directory", 'Wrong parent directory'); + Assert.AreNotEqual('', TempABSContainerContent."Blob Type", 'Wrong BLOB type'); + Assert.AreNotEqual('Directory', TempABSContainerContent."Content Type", 'Wrong content type'); + Assert.AreEqual(2, TempABSContainerContent.Level, 'Wrong BLOB level'); + + Assert.IsTrue(TempABSContainerContent.Next() <> 0, 'Directory does not exist'); + Assert.AreEqual('subsubfolder', TempABSContainerContent.Name, 'Wrong name'); + Assert.AreEqual('folder1/subfolder1/subsubfolder', TempABSContainerContent."Full Name", 'Wrong full name'); + Assert.AreEqual('folder1/subfolder1/', TempABSContainerContent."Parent Directory", 'Wrong parent directory'); + Assert.AreEqual('Directory', TempABSContainerContent."Content Type", 'Wrong content type'); + Assert.AreEqual('', TempABSContainerContent."Blob Type", 'Wrong BLOB type'); + Assert.AreEqual(2, TempABSContainerContent.Level, 'Wrong level'); + + Assert.IsTrue(TempABSContainerContent.Next() <> 0, 'BLOB does not exist'); + Assert.AreEqual('subsubfolderblob1', TempABSContainerContent.Name, 'Wrong name'); + Assert.AreEqual('folder1/subfolder1/subsubfolder/subsubfolderblob1', TempABSContainerContent."Full Name", 'Wrong full name'); + Assert.AreEqual('folder1/subfolder1/subsubfolder/', TempABSContainerContent."Parent Directory", 'Wrong parent directory'); + Assert.AreNotEqual('', TempABSContainerContent."Blob Type", 'Wrong BLOB type'); + Assert.AreNotEqual('Directory', TempABSContainerContent."Content Type", 'Wrong content type'); + Assert.AreEqual(3, TempABSContainerContent.Level, 'Wrong BLOB level'); + + Assert.IsTrue(TempABSContainerContent.Next() <> 0, 'BLOB does not exist'); + Assert.AreEqual('subsubfolderblob2', TempABSContainerContent.Name, 'Wrong name'); + Assert.AreEqual('folder1/subfolder1/subsubfolder/subsubfolderblob2', TempABSContainerContent."Full Name", 'Wrong full name'); + Assert.AreEqual('folder1/subfolder1/subsubfolder/', TempABSContainerContent."Parent Directory", 'Wrong parent directory'); + Assert.AreNotEqual('Directory', TempABSContainerContent."Content Type", 'Wrong content type'); + Assert.AreNotEqual('', TempABSContainerContent."Blob Type", 'Wrong BLOB type'); + Assert.AreEqual(3, TempABSContainerContent.Level, 'Wrong BLOB level'); + + Assert.IsTrue(TempABSContainerContent.Next() <> 0, 'Directory does not exist'); + Assert.AreEqual('subfolder2', TempABSContainerContent.Name, 'Wrong name'); + Assert.AreEqual('folder1/subfolder2', TempABSContainerContent."Full Name", 'Wrong full name'); + Assert.AreEqual('folder1/', TempABSContainerContent."Parent Directory", 'Wrong parent directory'); + Assert.AreEqual('', TempABSContainerContent."Blob Type", 'Wrong BLOB type'); + Assert.AreEqual('Directory', TempABSContainerContent."Content Type", 'Wrong content type'); + Assert.AreEqual(1, TempABSContainerContent.Level, 'Wrong level'); + + Assert.IsTrue(TempABSContainerContent.Next() <> 0, 'Directory does not exist'); + Assert.AreEqual('subsubfolder', TempABSContainerContent.Name, 'Wrong name'); + Assert.AreEqual('folder1/subfolder2/subsubfolder', TempABSContainerContent."Full Name", 'Wrong full name'); + Assert.AreEqual('folder1/subfolder2/', TempABSContainerContent."Parent Directory", 'Wrong parent directory'); + Assert.AreEqual('Directory', TempABSContainerContent."Content Type", 'Wrong content type'); + Assert.AreEqual('', TempABSContainerContent."Blob Type", 'Wrong BLOB type'); + Assert.AreEqual(2, TempABSContainerContent.Level, 'Wrong level'); + + Assert.IsTrue(TempABSContainerContent.Next() <> 0, 'BLOB does not exist'); + Assert.AreEqual('subsubfolderblob1', TempABSContainerContent.Name, 'Wrong name'); + Assert.AreEqual('folder1/subfolder2/subsubfolder/subsubfolderblob1', TempABSContainerContent."Full Name", 'Wrong full name'); + Assert.AreEqual('folder1/subfolder2/subsubfolder/', TempABSContainerContent."Parent Directory", 'Wrong parent directory'); + Assert.AreNotEqual('', TempABSContainerContent."Blob Type", 'Wrong BLOB type'); + Assert.AreNotEqual('Directory', TempABSContainerContent."Content Type", 'Wrong content type'); + Assert.AreEqual(3, TempABSContainerContent.Level, 'Wrong BLOB level'); + + Assert.IsTrue(TempABSContainerContent.Next() <> 0, 'BLOB does not exist'); + Assert.AreEqual('subsubfolderblob2', TempABSContainerContent.Name, 'Wrong name'); + Assert.AreEqual('folder1/subfolder2/subsubfolder/subsubfolderblob2', TempABSContainerContent."Full Name", 'Wrong full name'); + Assert.AreEqual('folder1/subfolder2/subsubfolder/', TempABSContainerContent."Parent Directory", 'Wrong parent directory'); + Assert.AreNotEqual('Directory', TempABSContainerContent."Content Type", 'Wrong content type'); + Assert.AreNotEqual('', TempABSContainerContent."Blob Type", 'Wrong BLOB type'); + Assert.AreEqual(3, TempABSContainerContent.Level, 'Wrong BLOB level'); + + Assert.IsTrue(TempABSContainerContent.Next() <> 0, 'BLOB does not exist'); + Assert.AreEqual('rootblob1', TempABSContainerContent.Name, 'Wrong name'); + Assert.AreEqual('rootblob1', TempABSContainerContent."Full Name", 'Wrong full name'); + Assert.AreEqual('', TempABSContainerContent."Parent Directory", 'Wrong parent directory'); + Assert.AreNotEqual('Directory', TempABSContainerContent."Content Type", 'Wrong content type'); + Assert.AreNotEqual('', TempABSContainerContent."Blob Type", 'Wrong BLOB type'); + Assert.AreEqual(0, TempABSContainerContent.Level, 'Wrong BLOB level'); + + Assert.IsTrue(TempABSContainerContent.Next() <> 0, 'BLOB does not exist'); + Assert.AreEqual('rootblob2', TempABSContainerContent.Name, 'Wrong name'); + Assert.AreEqual('rootblob2', TempABSContainerContent."Full Name", 'Wrong full name'); + Assert.AreEqual('', TempABSContainerContent."Parent Directory", 'Wrong parent directory'); + Assert.AreNotEqual('Directory', TempABSContainerContent."Content Type", 'Wrong content type'); + Assert.AreNotEqual('', TempABSContainerContent."Blob Type", 'Wrong BLOB type'); + Assert.AreEqual(0, TempABSContainerContent.Level, 'Wrong BLOB level'); + + Assert.IsTrue(TempABSContainerContent.Next() = 0, 'There should be no more entries'); // Clean-up ABSContainerClient.DeleteContainer(ContainerName); @@ -737,7 +737,7 @@ codeunit 132920 "ABS Blob Client Test" [Test] procedure ParseResponseWithHierarchicalBlobName() var - ABSContainerContent: Record "ABS Container Content"; + TempABSContainerContent: Record "ABS Container Content"; ABSHelperLibrary: Codeunit "ABS Helper Library"; BlobPrefixNodeList, BlobNodeList : XmlNodeList; NextMarker: Text; @@ -749,22 +749,22 @@ codeunit 132920 "ABS Blob Client Test" ABSHelperLibrary.CreateBlobNodeListFromResponse(ABSTestLibrary.GetServiceResponseBlobWithHierarchicalName(), NextMarker, BlobPrefixNodeList, BlobNodeList); // [WHEN] Invoke BlobNodeListToTempRecord - ABSHelperLibrary.BlobNodeListToTempRecord(BlobPrefixNodeList, BlobNodeList, ABSContainerContent); + ABSHelperLibrary.BlobNodeListToTempRecord(BlobPrefixNodeList, BlobNodeList, TempABSContainerContent); // [THEN] "ABS Container Content" contains one record "folder" and one record "blob" - Assert.RecordCount(ABSContainerContent, 2); + Assert.RecordCount(TempABSContainerContent, 2); - ABSContainerContent.SetRange(Name, ABSTestLibrary.GetSampleResponseRootDirName()); - Assert.RecordCount(ABSContainerContent, 1); + TempABSContainerContent.SetRange(Name, ABSTestLibrary.GetSampleResponseRootDirName()); + Assert.RecordCount(TempABSContainerContent, 1); - ABSContainerContent.SetRange(Name, ABSTestLibrary.GetSampleResponseFileName()); - Assert.RecordCount(ABSContainerContent, 1); + TempABSContainerContent.SetRange(Name, ABSTestLibrary.GetSampleResponseFileName()); + Assert.RecordCount(TempABSContainerContent, 1); end; [Test] procedure ParseResponseFromStorageHierarachicalNamespace() var - ABSContainerContent: Record "ABS Container Content"; + TempABSContainerContent: Record "ABS Container Content"; ABSHelperLibrary: Codeunit "ABS Helper Library"; BlobPrefixNodeList, BlobNodeList : XmlNodeList; NextMarker: Text; @@ -777,20 +777,20 @@ codeunit 132920 "ABS Blob Client Test" ABSHelperLibrary.CreateBlobNodeListFromResponse(ABSTestLibrary.GetServiceResponseHierarchicalNamespace(), NextMarker, BlobPrefixNodeList, BlobNodeList); // [WHEN] Invoke BlobNodeListToTempRecord - ABSHelperLibrary.BlobNodeListToTempRecord(BlobPrefixNodeList, BlobNodeList, ABSContainerContent); + ABSHelperLibrary.BlobNodeListToTempRecord(BlobPrefixNodeList, BlobNodeList, TempABSContainerContent); // [THEN] "ABS Container Content" contains two records with resource type "folder" and one record with resource type = "blob" - Assert.RecordCount(ABSContainerContent, 3); + Assert.RecordCount(TempABSContainerContent, 3); - VerifyContainerContentType(ABSContainerContent, CopyStr(ABSTestLibrary.GetSampleResponseRootDirName(), 1, MaxStrLen(ABSContainerContent.Name)), Enum::"ABS Blob Resource Type"::Directory); - VerifyContainerContentType(ABSContainerContent, CopyStr(ABSTestLibrary.GetSampleResponseSubdirName(), 1, MaxStrLen(ABSContainerContent.Name)), Enum::"ABS Blob Resource Type"::Directory); - VerifyContainerContentType(ABSContainerContent, CopyStr(ABSTestLibrary.GetSampleResponseFileName(), 1, MaxStrLen(ABSContainerContent.Name)), Enum::"ABS Blob Resource Type"::File); + VerifyContainerContentType(TempABSContainerContent, CopyStr(ABSTestLibrary.GetSampleResponseRootDirName(), 1, MaxStrLen(TempABSContainerContent.Name)), Enum::"ABS Blob Resource Type"::Directory); + VerifyContainerContentType(TempABSContainerContent, CopyStr(ABSTestLibrary.GetSampleResponseSubdirName(), 1, MaxStrLen(TempABSContainerContent.Name)), Enum::"ABS Blob Resource Type"::Directory); + VerifyContainerContentType(TempABSContainerContent, CopyStr(ABSTestLibrary.GetSampleResponseFileName(), 1, MaxStrLen(TempABSContainerContent.Name)), Enum::"ABS Blob Resource Type"::File); end; [Test] procedure ParseDelimetedResponse() var - ABSContainerContent: Record "ABS Container Content"; + TempABSContainerContent: Record "ABS Container Content"; ABSHelperLibrary: Codeunit "ABS Helper Library"; BlobPrefixNodeList, BlobNodeList : XmlNodeList; NextMarker: Text; @@ -803,15 +803,15 @@ codeunit 132920 "ABS Blob Client Test" ABSHelperLibrary.CreateBlobNodeListFromResponse(ABSTestLibrary.GetDelimitedServiceResponse(), NextMarker, BlobPrefixNodeList, BlobNodeList); // [WHEN] Invoke BlobNodeListToTempRecord - ABSHelperLibrary.BlobNodeListToTempRecord(BlobPrefixNodeList, BlobNodeList, ABSContainerContent); + ABSHelperLibrary.BlobNodeListToTempRecord(BlobPrefixNodeList, BlobNodeList, TempABSContainerContent); // [THEN] "ABS Container Content" contains three records with resource type "folder" and one record with resource type = "blob" - Assert.RecordCount(ABSContainerContent, 4); + Assert.RecordCount(TempABSContainerContent, 4); for i := 1 to 3 do - VerifyContainerContentType(ABSContainerContent, CopyStr(ABSTestLibrary.GetSampleResponseSubdirName() + Format(i), 1, MaxStrLen(ABSContainerContent.Name)), Enum::"ABS Blob Resource Type"::Directory); + VerifyContainerContentType(TempABSContainerContent, CopyStr(ABSTestLibrary.GetSampleResponseSubdirName() + Format(i), 1, MaxStrLen(TempABSContainerContent.Name)), Enum::"ABS Blob Resource Type"::Directory); - VerifyContainerContentType(ABSContainerContent, CopyStr(ABSTestLibrary.GetSampleResponseFileName(), 1, MaxStrLen(ABSContainerContent.Name)), Enum::"ABS Blob Resource Type"::File); + VerifyContainerContentType(TempABSContainerContent, CopyStr(ABSTestLibrary.GetSampleResponseFileName(), 1, MaxStrLen(TempABSContainerContent.Name)), Enum::"ABS Blob Resource Type"::File); end; [Test] // Failing if ran against azurite, as BLOB MetaData are not supported there @@ -860,13 +860,13 @@ codeunit 132920 "ABS Blob Client Test" ABSContainerClient.DeleteContainer(ContainerName); end; - local procedure VerifyContainerContentType(var ABSContainerContent: Record "ABS Container Content"; BlobName: Text[2048]; ExpectedResourceType: Enum "ABS Blob Resource Type") + local procedure VerifyContainerContentType(var TempABSContainerContent: Record "ABS Container Content"; BlobName: Text[2048]; ExpectedResourceType: Enum "ABS Blob Resource Type") var IncorrectBlobPropertyErr: Label 'BLOB property is assigned incorrectly'; begin - ABSContainerContent.SetRange(Name, BlobName); - ABSContainerContent.FindFirst(); - Assert.AreEqual(ExpectedResourceType, ABSContainerContent."Resource Type", IncorrectBlobPropertyErr); + TempABSContainerContent.SetRange(Name, BlobName); + TempABSContainerContent.FindFirst(); + Assert.AreEqual(ExpectedResourceType, TempABSContainerContent."Resource Type", IncorrectBlobPropertyErr); end; local procedure GetBlobTagsFromABSContainerBlobList(BlobName: Text; BlobList: Dictionary of [Text, XmlNode]): Dictionary of [Text, Text] diff --git a/src/System Application/Test/Azure Blob Services API/src/ABSContainerClientTest.Codeunit.al b/src/System Application/Test/Azure Blob Services API/src/ABSContainerClientTest.Codeunit.al index b192e2b2f1..308b36b264 100644 --- a/src/System Application/Test/Azure Blob Services API/src/ABSContainerClientTest.Codeunit.al +++ b/src/System Application/Test/Azure Blob Services API/src/ABSContainerClientTest.Codeunit.al @@ -62,7 +62,7 @@ codeunit 132919 "ABS Container Client Test" [Test] procedure ListContainersTest() var - Containers: Record "ABS Container"; + TempContainers: Record "ABS Container"; Response: Codeunit "ABS Operation Response"; ContainerNames: List of [Text]; ContainerName: Text; @@ -79,13 +79,13 @@ codeunit 132919 "ABS Container Client Test" Assert.IsTrue(Response.IsSuccessful(), 'Operation CreateContainer failed'); end; - Response := ABSContainerClient.ListContainers(Containers); + Response := ABSContainerClient.ListContainers(TempContainers); Assert.IsTrue(Response.IsSuccessful(), 'Operation ListContainers failed'); - Assert.AreEqual(ContainerNames.Count(), Containers.Count(), 'Number of created containers mismatch'); + Assert.AreEqual(ContainerNames.Count(), TempContainers.Count(), 'Number of created TempContainers mismatch'); foreach ContainerName in ContainerNames do - Assert.IsTrue(Containers.Get(ContainerName), 'Could not find container ' + ContainerName); + Assert.IsTrue(TempContainers.Get(ContainerName), 'Could not find container ' + ContainerName); // Clean up foreach ContainerName in ContainerNames do begin diff --git a/src/System Application/Test/Azure Blob Services API/src/AzuriteTestLibrary.Codeunit.al b/src/System Application/Test/Azure Blob Services API/src/AzuriteTestLibrary.Codeunit.al index 7c80eb6599..d21c9f5c48 100644 --- a/src/System Application/Test/Azure Blob Services API/src/AzuriteTestLibrary.Codeunit.al +++ b/src/System Application/Test/Azure Blob Services API/src/AzuriteTestLibrary.Codeunit.al @@ -25,7 +25,7 @@ codeunit 132923 "Azurite Test Library" /// procedure ClearStorageAccount() var - Container: Record "ABS Container"; + TempContainer: Record "ABS Container"; ABSContainerClient: Codeunit "ABS Container Client"; StorageServiceAuthorization: Codeunit "Storage Service Authorization"; Authorization: Interface "Storage Service Authorization"; @@ -33,14 +33,14 @@ codeunit 132923 "Azurite Test Library" Authorization := StorageServiceAuthorization.CreateSharedKey(GetAccessKey()); ABSContainerClient.Initialize(GetStorageAccountName(), Authorization); - ABSContainerClient.ListContainers(Container); + ABSContainerClient.ListContainers(TempContainer); - if not Container.Find('-') then + if not TempContainer.Find('-') then exit; repeat - ABSContainerClient.DeleteContainer(Container.Name); - until Container.Next() = 0; + ABSContainerClient.DeleteContainer(TempContainer.Name); + until TempContainer.Next() = 0; end; /// diff --git a/src/System Application/Test/Azure File Services API/src/AFSFileClientTest.Codeunit.al b/src/System Application/Test/Azure File Services API/src/AFSFileClientTest.Codeunit.al index 7b23e22ff2..0a6a53768c 100644 --- a/src/System Application/Test/Azure File Services API/src/AFSFileClientTest.Codeunit.al +++ b/src/System Application/Test/Azure File Services API/src/AFSFileClientTest.Codeunit.al @@ -99,7 +99,7 @@ codeunit 132520 "AFS File Client Test" [Test] procedure MaxResultsAndMarkerTest() var - AFSDirectoryContent: Record "AFS Directory Content"; + TempAFSDirectoryContent: Record "AFS Directory Content"; AFSFileClient: Codeunit "AFS File Client"; AFSOperationResponse: Codeunit "AFS Operation Response"; AFSOptionalParameters: Codeunit "AFS Optional Parameters"; @@ -127,33 +127,33 @@ codeunit 132520 "AFS File Client Test" // [WHEN] The programmer runs a list operation on the root directory AFSFileClient.Initialize(AFSInitTestStorage.GetStorageAccountName(), AFSInitTestStorage.GetFileShareName(), SharedKeyAuthorization); - AFSOperationResponse := AFSFileClient.ListDirectory('', AFSDirectoryContent, AFSOptionalParameters); + AFSOperationResponse := AFSFileClient.ListDirectory('', TempAFSDirectoryContent, AFSOptionalParameters); LibraryAssert.IsTrue(AFSOperationResponse.IsSuccessful(), AFSOperationResponse.GetError()); // [THEN] Only the first entry parentdir must be returned and a marker must be set - LibraryAssert.AreEqual(1, AFSDirectoryContent.Count(), 'Wrong number of files and/or directories returned with MaxResults set.'); - LibraryAssert.AreNotEqual('', AFSDirectoryContent."Next Marker", 'Next Marker must not be empty.'); + LibraryAssert.AreEqual(1, TempAFSDirectoryContent.Count(), 'Wrong number of files and/or directories returned with MaxResults set.'); + LibraryAssert.AreNotEqual('', TempAFSDirectoryContent."Next Marker", 'Next Marker must not be empty.'); - AFSDirectoryContent.SetRange("Full Name", 'parentdir'); - LibraryAssert.RecordIsNotEmpty(AFSDirectoryContent); + TempAFSDirectoryContent.SetRange("Full Name", 'parentdir'); + LibraryAssert.RecordIsNotEmpty(TempAFSDirectoryContent); // [WHEN] The programmer runs a further list operation on the root directory with the returned marker set - AFSOptionalParameters.Marker(AFSDirectoryContent."Next Marker"); - AFSOperationResponse := AFSFileClient.ListDirectory('', AFSDirectoryContent, AFSOptionalParameters); + AFSOptionalParameters.Marker(TempAFSDirectoryContent."Next Marker"); + AFSOperationResponse := AFSFileClient.ListDirectory('', TempAFSDirectoryContent, AFSOptionalParameters); LibraryAssert.IsTrue(AFSOperationResponse.IsSuccessful(), AFSOperationResponse.GetError()); // [THEN] The second entry anotherdir must be returned and the marker must be cleared - LibraryAssert.AreEqual(1, AFSDirectoryContent.Count(), 'Wrong number of files and/or directories returned with MaxResults set.'); - LibraryAssert.AreEqual('', AFSDirectoryContent."Next Marker", 'Next Marker must be empty.'); + LibraryAssert.AreEqual(1, TempAFSDirectoryContent.Count(), 'Wrong number of files and/or directories returned with MaxResults set.'); + LibraryAssert.AreEqual('', TempAFSDirectoryContent."Next Marker", 'Next Marker must be empty.'); - AFSDirectoryContent.SetRange("Full Name", 'anotherdir'); - LibraryAssert.RecordIsNotEmpty(AFSDirectoryContent); + TempAFSDirectoryContent.SetRange("Full Name", 'anotherdir'); + LibraryAssert.RecordIsNotEmpty(TempAFSDirectoryContent); end; [Test] procedure ListDirectoryTest() var - AFSDirectoryContent: Record "AFS Directory Content"; + TempAFSDirectoryContent: Record "AFS Directory Content"; AFSFileClient: Codeunit "AFS File Client"; AFSOperationResponse: Codeunit "AFS Operation Response"; begin @@ -177,21 +177,21 @@ codeunit 132520 "AFS File Client Test" // [WHEN] The programmer runs a list operation on the parent directory AFSFileClient.Initialize(AFSInitTestStorage.GetStorageAccountName(), AFSInitTestStorage.GetFileShareName(), SharedKeyAuthorization); - AFSOperationResponse := AFSFileClient.ListDirectory('', AFSDirectoryContent); + AFSOperationResponse := AFSFileClient.ListDirectory('', TempAFSDirectoryContent); LibraryAssert.AreEqual(true, AFSOperationResponse.IsSuccessful(), AFSOperationResponse.GetError()); // [THEN] A correct list of files and/or directories is returned - LibraryAssert.AreEqual(2, AFSDirectoryContent.Count(), 'Wrong number of files and/or directories returned.'); - AFSDirectoryContent.SetRange("Full Name", 'parentdir'); - LibraryAssert.RecordIsNotEmpty(AFSDirectoryContent); - AFSDirectoryContent.SetRange("Full Name", 'anotherdir'); - LibraryAssert.RecordIsNotEmpty(AFSDirectoryContent); + LibraryAssert.AreEqual(2, TempAFSDirectoryContent.Count(), 'Wrong number of files and/or directories returned.'); + TempAFSDirectoryContent.SetRange("Full Name", 'parentdir'); + LibraryAssert.RecordIsNotEmpty(TempAFSDirectoryContent); + TempAFSDirectoryContent.SetRange("Full Name", 'anotherdir'); + LibraryAssert.RecordIsNotEmpty(TempAFSDirectoryContent); end; [Test] procedure ListDirectoryWithTimestampsAndEtagTest() var - AFSDirectoryContent: Record "AFS Directory Content"; + TempAFSDirectoryContent: Record "AFS Directory Content"; AFSFileClient: Codeunit "AFS File Client"; AFSOperationResponse: Codeunit "AFS Operation Response"; AFSOptionalParameters: Codeunit "AFS Optional Parameters"; @@ -222,16 +222,16 @@ codeunit 132520 "AFS File Client Test" // [WHEN] The programmer runs a list operation on the anotherdir/ directory with the parameters requesting timestamps and etag AFSFileClient.Initialize(AFSInitTestStorage.GetStorageAccountName(), AFSInitTestStorage.GetFileShareName(), SharedKeyAuthorization); - AFSOperationResponse := AFSFileClient.ListDirectory('anotherdir/', AFSDirectoryContent, AFSOptionalParameters); + AFSOperationResponse := AFSFileClient.ListDirectory('anotherdir/', TempAFSDirectoryContent, AFSOptionalParameters); LibraryAssert.IsTrue(AFSOperationResponse.IsSuccessful(), AFSOperationResponse.GetError()); // [THEN] Directory and file entries must contain timestamps and etag - AFSDirectoryContent.FindSet(); + TempAFSDirectoryContent.FindSet(); repeat - LibraryAssert.AreNotEqual(0DT, AFSDirectoryContent."Creation Time", 'Timestamp CreationTime must be set'); - LibraryAssert.AreNotEqual('', AFSDirectoryContent.Etag, 'Etag must be set'); - until AFSDirectoryContent.Next() = 0; + LibraryAssert.AreNotEqual(0DT, TempAFSDirectoryContent."Creation Time", 'Timestamp CreationTime must be set'); + LibraryAssert.AreNotEqual('', TempAFSDirectoryContent.Etag, 'Etag must be set'); + until TempAFSDirectoryContent.Next() = 0; end; [Test] @@ -313,7 +313,7 @@ codeunit 132520 "AFS File Client Test" [Test] procedure DeleteDirectoryTest() var - AFSDirectoryContent: Record "AFS Directory Content"; + TempAFSDirectoryContent: Record "AFS Directory Content"; AFSFileClient: Codeunit "AFS File Client"; AFSOperationResponse: Codeunit "AFS Operation Response"; begin @@ -341,7 +341,7 @@ codeunit 132520 "AFS File Client Test" LibraryAssert.AreEqual(true, AFSOperationResponse.IsSuccessful(), AFSOperationResponse.GetError()); // [THEN] The operation is succesful and the directory is deleted - AFSOperationResponse := AFSFileClient.ListDirectory('anotherdir/emptydir', AFSDirectoryContent); + AFSOperationResponse := AFSFileClient.ListDirectory('anotherdir/emptydir', TempAFSDirectoryContent); LibraryAssert.AreEqual(false, AFSOperationResponse.IsSuccessful(), 'The directory should not exist.'); end; diff --git a/src/System Application/Test/Azure File Services API/src/AFSInitTestStorage.Codeunit.al b/src/System Application/Test/Azure File Services API/src/AFSInitTestStorage.Codeunit.al index 83e6bc868d..a197bf3767 100644 --- a/src/System Application/Test/Azure File Services API/src/AFSInitTestStorage.Codeunit.al +++ b/src/System Application/Test/Azure File Services API/src/AFSInitTestStorage.Codeunit.al @@ -22,35 +22,35 @@ codeunit 132519 "AFS Init. Test Storage" procedure ClearFileShare(): Text var - AFSDirectoryContent: Record "AFS Directory Content"; + TempAFSDirectoryContent: Record "AFS Directory Content"; AFSFileClient: Codeunit "AFS File Client"; Visited: List of [Text]; begin AFSFileClient.Initialize(GetStorageAccountName(), GetFileShareName(), AFSGetTestStorageAuth.GetDefaultAccountSAS()); - AFSFileClient.ListDirectory('', AFSDirectoryContent); - if not AFSDirectoryContent.FindSet() then + AFSFileClient.ListDirectory('', TempAFSDirectoryContent); + if not TempAFSDirectoryContent.FindSet() then exit; - DeleteDirectoryRecursive(AFSFileClient, AFSDirectoryContent, Visited); + DeleteDirectoryRecursive(AFSFileClient, TempAFSDirectoryContent, Visited); end; - local procedure DeleteDirectoryRecursive(var AFSFileClient: Codeunit "AFS File Client"; var AFSDirectoryContent: Record "AFS Directory Content"; var Visited: List of [Text]) + local procedure DeleteDirectoryRecursive(var AFSFileClient: Codeunit "AFS File Client"; var TempAFSDirectoryContent: Record "AFS Directory Content"; var Visited: List of [Text]) var - AFSDirectoryContentLocal: Record "AFS Directory Content"; + TempAFSDirectoryContentLocal: Record "AFS Directory Content"; begin - if not AFSDirectoryContent.FindSet() then + if not TempAFSDirectoryContent.FindSet() then exit; repeat - if not Visited.Contains(AFSDirectoryContent."Full Name") then - if AFSDirectoryContent."Resource Type" = AFSDirectoryContent."Resource Type"::File then - AFSFileClient.DeleteFile(AFSDirectoryContent."Full Name") + if not Visited.Contains(TempAFSDirectoryContent."Full Name") then + if TempAFSDirectoryContent."Resource Type" = TempAFSDirectoryContent."Resource Type"::File then + AFSFileClient.DeleteFile(TempAFSDirectoryContent."Full Name") else begin - AFSFileClient.ListDirectory(AFSDirectoryContent."Full Name", AFSDirectoryContentLocal); - Visited.Add(AFSDirectoryContent."Full Name"); - DeleteDirectoryRecursive(AFSFileClient, AFSDirectoryContentLocal, Visited); - AFSFileClient.DeleteDirectory(AFSDirectoryContent."Full Name"); - Visited.Remove(AFSDirectoryContent."Full Name"); + AFSFileClient.ListDirectory(TempAFSDirectoryContent."Full Name", TempAFSDirectoryContentLocal); + Visited.Add(TempAFSDirectoryContent."Full Name"); + DeleteDirectoryRecursive(AFSFileClient, TempAFSDirectoryContentLocal, Visited); + AFSFileClient.DeleteDirectory(TempAFSDirectoryContent."Full Name"); + Visited.Remove(TempAFSDirectoryContent."Full Name"); end; - until AFSDirectoryContent.Next() = 0; + until TempAFSDirectoryContent.Next() = 0; end; /// diff --git a/src/System Application/Test/Barcode/src/Dynamics2D/Dynamics2DQrCodeTest.Codeunit.al b/src/System Application/Test/Barcode/src/Dynamics2D/Dynamics2DQrCodeTest.Codeunit.al index 7d72623f33..ac4868bc26 100644 --- a/src/System Application/Test/Barcode/src/Dynamics2D/Dynamics2DQrCodeTest.Codeunit.al +++ b/src/System Application/Test/Barcode/src/Dynamics2D/Dynamics2DQrCodeTest.Codeunit.al @@ -39,19 +39,19 @@ codeunit 135061 "Dynamics 2D QR Code Test" [Test] procedure MaxCapacityStringToQRCodeTest() var - BarcodeEncodeSettings2D: Record "Barcode Encode Settings 2D"; + TempBarcodeEncodeSettings2D: Record "Barcode Encode Settings 2D"; TempBlob: Codeunit "Temp Blob"; IBarcodeImageProvider2D: Interface "Barcode Image Provider 2D"; BarcodeImageProvider2D: Enum "Barcode Image Provider 2D"; begin // [SCENARIO] A 1273 byte string is converted to an Version 40 QR code with High Error Correction Level (Max Capacity 1273 bytes) IBarcodeImageProvider2D := BarcodeImageProvider2D::Dynamics2D; - BarcodeEncodeSettings2D.Init(); - BarcodeEncodeSettings2D."Error Correction Level" := BarcodeEncodeSettings2D."Error Correction Level"::High; - BarcodeEncodeSettings2D."Module Size" := 1; + TempBarcodeEncodeSettings2D.Init(); + TempBarcodeEncodeSettings2D."Error Correction Level" := TempBarcodeEncodeSettings2D."Error Correction Level"::High; + TempBarcodeEncodeSettings2D."Module Size" := 1; // [WHEN] The string is converted - TempBlob := IBarcodeImageProvider2D.EncodeImage(GetMaxAlphaNumericString(false), Enum::"Barcode Symbology 2D"::"QR-Code", BarcodeEncodeSettings2D); + TempBlob := IBarcodeImageProvider2D.EncodeImage(GetMaxAlphaNumericString(false), Enum::"Barcode Symbology 2D"::"QR-Code", TempBarcodeEncodeSettings2D); // [THEN] no error occured Assert.IsTrue(TempBlob.HasValue(), 'No QR Code image created.'); @@ -60,7 +60,7 @@ codeunit 135061 "Dynamics 2D QR Code Test" [Test] procedure MaxCapacityExceededStringToQRCodeTest() var - BarcodeEncodeSettings2D: Record "Barcode Encode Settings 2D"; + TempBarcodeEncodeSettings2D: Record "Barcode Encode Settings 2D"; IBarcodeImageProvider2D: Interface "Barcode Image Provider 2D"; BarcodeImageProvider2D: Enum "Barcode Image Provider 2D"; begin @@ -68,12 +68,12 @@ codeunit 135061 "Dynamics 2D QR Code Test" ClearLastError(); IBarcodeImageProvider2D := BarcodeImageProvider2D::Dynamics2D; - BarcodeEncodeSettings2D.Init(); - BarcodeEncodeSettings2D."Error Correction Level" := BarcodeEncodeSettings2D."Error Correction Level"::High; - BarcodeEncodeSettings2D."Module Size" := 1; + TempBarcodeEncodeSettings2D.Init(); + TempBarcodeEncodeSettings2D."Error Correction Level" := TempBarcodeEncodeSettings2D."Error Correction Level"::High; + TempBarcodeEncodeSettings2D."Module Size" := 1; // [WHEN] The string is converted - asserterror IBarcodeImageProvider2D.EncodeImage(GetMaxAlphaNumericString(true), Enum::"Barcode Symbology 2D"::"QR-Code", BarcodeEncodeSettings2D); + asserterror IBarcodeImageProvider2D.EncodeImage(GetMaxAlphaNumericString(true), Enum::"Barcode Symbology 2D"::"QR-Code", TempBarcodeEncodeSettings2D); // [THEN] 'Cannot accommodate input length.' error expected Assert.ExpectedError('Cannot accommodate input length.'); diff --git a/src/System Application/Test/Barcode/src/IDAutomation1D/IDA1DCode128Test.Codeunit.al b/src/System Application/Test/Barcode/src/IDAutomation1D/IDA1DCode128Test.Codeunit.al index 906c70bf17..4ba20c946e 100644 --- a/src/System Application/Test/Barcode/src/IDAutomation1D/IDA1DCode128Test.Codeunit.al +++ b/src/System Application/Test/Barcode/src/IDAutomation1D/IDA1DCode128Test.Codeunit.al @@ -18,54 +18,54 @@ codeunit 135043 "IDA 1D Code128 Test" [Test] procedure TestCode128aEncoding(); var - BarcodeEncodeSettings: Record "Barcode Encode Settings"; + TempBarcodeEncodeSettings: Record "Barcode Encode Settings"; GenericBarcodeTestHelper: Codeunit "Generic Barcode Test Helper"; begin // [Scenario] Encoding a text using Code128 symbology with code set 'A' yields the correct result - BarcodeEncodeSettings."Code Set" := BarcodeEncodeSettings."Code Set"::A; + TempBarcodeEncodeSettings."Code Set" := TempBarcodeEncodeSettings."Code Set"::A; - GenericBarcodeTestHelper.EncodeFontSuccessTest(/* input */'1234', Enum::"Barcode Symbology"::Code128, BarcodeEncodeSettings, /* expected result */'Ë1234wÎ'); + GenericBarcodeTestHelper.EncodeFontSuccessTest(/* input */'1234', Enum::"Barcode Symbology"::Code128, TempBarcodeEncodeSettings, /* expected result */'Ë1234wÎ'); end; [Test] procedure TestCode128bEncoding(); var - BarcodeEncodeSettings: Record "Barcode Encode Settings"; + TempBarcodeEncodeSettings: Record "Barcode Encode Settings"; GenericBarcodeTestHelper: Codeunit "Generic Barcode Test Helper"; begin // [Scenario] Encoding a text using Code128 symbology with code set 'B' yields the correct result - BarcodeEncodeSettings."Code Set" := BarcodeEncodeSettings."Code Set"::B; + TempBarcodeEncodeSettings."Code Set" := TempBarcodeEncodeSettings."Code Set"::B; - GenericBarcodeTestHelper.EncodeFontSuccessTest(/* input */'1234', Enum::"Barcode Symbology"::Code128, BarcodeEncodeSettings, /* expected result */'Ì1234xÎ'); + GenericBarcodeTestHelper.EncodeFontSuccessTest(/* input */'1234', Enum::"Barcode Symbology"::Code128, TempBarcodeEncodeSettings, /* expected result */'Ì1234xÎ'); end; [Test] procedure TestCode128cEncoding(); var - BarcodeEncodeSettings: Record "Barcode Encode Settings"; + TempBarcodeEncodeSettings: Record "Barcode Encode Settings"; GenericBarcodeTestHelper: Codeunit "Generic Barcode Test Helper"; begin // [Scenario] Encoding a text using Code128 symbology with code set 'C' yields the correct result - BarcodeEncodeSettings."Code Set" := BarcodeEncodeSettings."Code Set"::C; + TempBarcodeEncodeSettings."Code Set" := TempBarcodeEncodeSettings."Code Set"::C; - GenericBarcodeTestHelper.EncodeFontSuccessTest(/* input */'1234', Enum::"Barcode Symbology"::Code128, BarcodeEncodeSettings, /* expected result */'Í,BrÎ'); + GenericBarcodeTestHelper.EncodeFontSuccessTest(/* input */'1234', Enum::"Barcode Symbology"::Code128, TempBarcodeEncodeSettings, /* expected result */'Í,BrÎ'); end; [Test] procedure TestCode128EncodingWithNoCodeSetSelected(); var - BarcodeEncodeSettings: Record "Barcode Encode Settings"; + TempBarcodeEncodeSettings: Record "Barcode Encode Settings"; GenericBarcodeTestHelper: Codeunit "Generic Barcode Test Helper"; begin // [Scenario] Encoding a text using Code128 symbology with no code set set yields an error - BarcodeEncodeSettings."Code Set" := BarcodeEncodeSettings."Code Set"::None; + TempBarcodeEncodeSettings."Code Set" := TempBarcodeEncodeSettings."Code Set"::None; GenericBarcodeTestHelper.EncodeFontSuccessTest(/* input */'1234', Enum::"Barcode Symbology"::Code128, 'Í,BrÎ'); - GenericBarcodeTestHelper.EncodeFontSuccessTest(/* input */'1234', Enum::"Barcode Symbology"::Code128, BarcodeEncodeSettings, /* expected result */'Í,BrÎ'); + GenericBarcodeTestHelper.EncodeFontSuccessTest(/* input */'1234', Enum::"Barcode Symbology"::Code128, TempBarcodeEncodeSettings, /* expected result */'Í,BrÎ'); end; [Test] @@ -81,52 +81,52 @@ codeunit 135043 "IDA 1D Code128 Test" [Test] procedure TestCode128aValidationWithNormalString(); var - BarcodeEncodeSettings: Record "Barcode Encode Settings"; + TempBarcodeEncodeSettings: Record "Barcode Encode Settings"; GenericBarcodeTestHelper: Codeunit "Generic Barcode Test Helper"; begin // [Scenario] Validating a correctly formatted text using Code128 symbology with code set 'A' doesn't yield an error - BarcodeEncodeSettings."Code Set" := BarcodeEncodeSettings."Code Set"::A; + TempBarcodeEncodeSettings."Code Set" := TempBarcodeEncodeSettings."Code Set"::A; - GenericBarcodeTestHelper.ValidateFontSuccessTest(/* input */'1234', Enum::"Barcode Symbology"::Code128, BarcodeEncodeSettings); + GenericBarcodeTestHelper.ValidateFontSuccessTest(/* input */'1234', Enum::"Barcode Symbology"::Code128, TempBarcodeEncodeSettings); end; [Test] procedure TestCode128aValidationWithInvalidString(); var - BarcodeEncodeSettings: Record "Barcode Encode Settings"; + TempBarcodeEncodeSettings: Record "Barcode Encode Settings"; GenericBarcodeTestHelper: Codeunit "Generic Barcode Test Helper"; begin // [Scenario] Validating an incorrectly formatted text using Code128 symbology with code set 'A' yields an error - BarcodeEncodeSettings."Code Set" := BarcodeEncodeSettings."Code Set"::A; + TempBarcodeEncodeSettings."Code Set" := TempBarcodeEncodeSettings."Code Set"::A; - GenericBarcodeTestHelper.ValidateFontFailureTest(/* input */'lowercase', Enum::"Barcode Symbology"::Code128, BarcodeEncodeSettings, /* expected error */StrSubstNo(InvalidTextErr, 'lowercase')); + GenericBarcodeTestHelper.ValidateFontFailureTest(/* input */'lowercase', Enum::"Barcode Symbology"::Code128, TempBarcodeEncodeSettings, /* expected error */StrSubstNo(InvalidTextErr, 'lowercase')); end; [Test] procedure TestCode128bValidationWithInvalidString(); var - BarcodeEncodeSettings: Record "Barcode Encode Settings"; + TempBarcodeEncodeSettings: Record "Barcode Encode Settings"; GenericBarcodeTestHelper: Codeunit "Generic Barcode Test Helper"; begin // [Scenario] Validating an incorrectly formatted text using Code128 symbology with code set 'B' yields an error - BarcodeEncodeSettings."Code Set" := BarcodeEncodeSettings."Code Set"::B; + TempBarcodeEncodeSettings."Code Set" := TempBarcodeEncodeSettings."Code Set"::B; - GenericBarcodeTestHelper.ValidateFontFailureTest(/* input */'€€€', Enum::"Barcode Symbology"::Code128, BarcodeEncodeSettings, /* expected error */StrSubstNo(InvalidTextErr, '€€€')); + GenericBarcodeTestHelper.ValidateFontFailureTest(/* input */'€€€', Enum::"Barcode Symbology"::Code128, TempBarcodeEncodeSettings, /* expected error */StrSubstNo(InvalidTextErr, '€€€')); end; [Test] procedure TestCode128cValidationWithInvalidString(); var - BarcodeEncodeSettings: Record "Barcode Encode Settings"; + TempBarcodeEncodeSettings: Record "Barcode Encode Settings"; GenericBarcodeTestHelper: Codeunit "Generic Barcode Test Helper"; begin // [Scenario] Validating an incorrectly formatted text using Code128 symbology with code set 'C' yields an error - BarcodeEncodeSettings."Code Set" := BarcodeEncodeSettings."Code Set"::C; + TempBarcodeEncodeSettings."Code Set" := TempBarcodeEncodeSettings."Code Set"::C; - GenericBarcodeTestHelper.ValidateFontFailureTest(/* input */'ABC', Enum::"Barcode Symbology"::Code128, BarcodeEncodeSettings, /* expected error */StrSubstNo(InvalidTextErr, 'ABC')); + GenericBarcodeTestHelper.ValidateFontFailureTest(/* input */'ABC', Enum::"Barcode Symbology"::Code128, TempBarcodeEncodeSettings, /* expected error */StrSubstNo(InvalidTextErr, 'ABC')); end; } diff --git a/src/System Application/Test/Barcode/src/IDAutomation1D/IDA1DCode39Test.Codeunit.al b/src/System Application/Test/Barcode/src/IDAutomation1D/IDA1DCode39Test.Codeunit.al index 1d745eb855..7d3b008990 100644 --- a/src/System Application/Test/Barcode/src/IDAutomation1D/IDA1DCode39Test.Codeunit.al +++ b/src/System Application/Test/Barcode/src/IDAutomation1D/IDA1DCode39Test.Codeunit.al @@ -25,41 +25,41 @@ codeunit 135044 "IDA 1D Code39 Test" [Test] procedure TestCode39EncodingWithChecksum(); var - BarcodeEncodeSettings: Record "Barcode Encode Settings"; + TempBarcodeEncodeSettings: Record "Barcode Encode Settings"; GenericBarcodeTestHelper: Codeunit "Generic Barcode Test Helper"; begin // [Scenario] Encoding a valid text with checksum enabled using Code39 symbology yields the correct result - BarcodeEncodeSettings."Enable Checksum" := true; + TempBarcodeEncodeSettings."Enable Checksum" := true; - GenericBarcodeTestHelper.EncodeFontSuccessTest(/* input */'1234', Enum::"Barcode Symbology"::Code39, BarcodeEncodeSettings, /* expected result */'(1234A) '); + GenericBarcodeTestHelper.EncodeFontSuccessTest(/* input */'1234', Enum::"Barcode Symbology"::Code39, TempBarcodeEncodeSettings, /* expected result */'(1234A) '); end; [Test] procedure TestCode39EncodingWithExtCharSet(); var - BarcodeEncodeSettings: Record "Barcode Encode Settings"; + TempBarcodeEncodeSettings: Record "Barcode Encode Settings"; GenericBarcodeTestHelper: Codeunit "Generic Barcode Test Helper"; begin // [Scenario] Encoding a valid text using Code39 symbology with "Allow Extended Charset" yields the correct result - BarcodeEncodeSettings."Allow Extended Charset" := true; + TempBarcodeEncodeSettings."Allow Extended Charset" := true; - GenericBarcodeTestHelper.EncodeFontSuccessTest(/* input */'>abcd<', Enum::"Barcode Symbology"::Code39, BarcodeEncodeSettings, /* expected result */'(%I+A+B+C+D%G)'); + GenericBarcodeTestHelper.EncodeFontSuccessTest(/* input */'>abcd<', Enum::"Barcode Symbology"::Code39, TempBarcodeEncodeSettings, /* expected result */'(%I+A+B+C+D%G)'); end; [Test] procedure TestCode39EncodingWithChecksumAndExtCharSet(); var - BarcodeEncodeSettings: Record "Barcode Encode Settings"; + TempBarcodeEncodeSettings: Record "Barcode Encode Settings"; GenericBarcodeTestHelper: Codeunit "Generic Barcode Test Helper"; begin // [Scenario] Encoding a valid text with checksum enabled using Code39 symbology with "Allow Extended Charset" yields the correct result - BarcodeEncodeSettings."Allow Extended Charset" := true; - BarcodeEncodeSettings."Enable Checksum" := true; + TempBarcodeEncodeSettings."Allow Extended Charset" := true; + TempBarcodeEncodeSettings."Enable Checksum" := true; - GenericBarcodeTestHelper.EncodeFontSuccessTest(/* input */'>abcd<', Enum::"Barcode Symbology"::Code39, BarcodeEncodeSettings, /* expected result */'(%I+A+B+C+D%GR) '); + GenericBarcodeTestHelper.EncodeFontSuccessTest(/* input */'>abcd<', Enum::"Barcode Symbology"::Code39, TempBarcodeEncodeSettings, /* expected result */'(%I+A+B+C+D%GR) '); end; [Test] @@ -85,14 +85,14 @@ codeunit 135044 "IDA 1D Code39 Test" [Test] procedure TestCode39ValidationWithNormalStringExtCharSet(); var - BarcodeEncodeSettings: Record "Barcode Encode Settings"; + TempBarcodeEncodeSettings: Record "Barcode Encode Settings"; GenericBarcodeTestHelper: Codeunit "Generic Barcode Test Helper"; begin // [Scenario] Validating a correctly formatted text using Code39 symbology with "Allow Extended Charset" doesn't yield an error - BarcodeEncodeSettings."Allow Extended Charset" := true; + TempBarcodeEncodeSettings."Allow Extended Charset" := true; - GenericBarcodeTestHelper.ValidateFontSuccessTest(/* input */'1234abcd', Enum::"Barcode Symbology"::Code39, BarcodeEncodeSettings); + GenericBarcodeTestHelper.ValidateFontSuccessTest(/* input */'1234abcd', Enum::"Barcode Symbology"::Code39, TempBarcodeEncodeSettings); end; [Test] diff --git a/src/System Application/Test/Barcode/src/IDAutomation1D/IDA1DCode93Test.Codeunit.al b/src/System Application/Test/Barcode/src/IDAutomation1D/IDA1DCode93Test.Codeunit.al index 15d10f6af6..91725fadbc 100644 --- a/src/System Application/Test/Barcode/src/IDAutomation1D/IDA1DCode93Test.Codeunit.al +++ b/src/System Application/Test/Barcode/src/IDAutomation1D/IDA1DCode93Test.Codeunit.al @@ -45,14 +45,14 @@ codeunit 135045 "IDA 1D Code93 Test" [Test] procedure TestCode93ValidationWithNormalStringExtCharSet(); var - BarcodeEncodeSettings: Record "Barcode Encode Settings"; + TempBarcodeEncodeSettings: Record "Barcode Encode Settings"; GenericBarcodeTestHelper: Codeunit "Generic Barcode Test Helper"; begin // [Scenario] Validating a correctly formatted text using Code93 symbology with "Allow Extended Charset" doesn't yield an error - BarcodeEncodeSettings."Allow Extended Charset" := true; + TempBarcodeEncodeSettings."Allow Extended Charset" := true; - GenericBarcodeTestHelper.ValidateFontSuccessTest(/* input */'1234abcd', Enum::"Barcode Symbology"::Code93, BarcodeEncodeSettings); + GenericBarcodeTestHelper.ValidateFontSuccessTest(/* input */'1234abcd', Enum::"Barcode Symbology"::Code93, TempBarcodeEncodeSettings); end; [Test] diff --git a/src/System Application/Test/Email/src/EmailAccountsTest.Codeunit.al b/src/System Application/Test/Email/src/EmailAccountsTest.Codeunit.al index 72184896b3..328360d1b9 100644 --- a/src/System Application/Test/Email/src/EmailAccountsTest.Codeunit.al +++ b/src/System Application/Test/Email/src/EmailAccountsTest.Codeunit.al @@ -26,7 +26,7 @@ codeunit 134686 "Email Accounts Test" [TransactionModel(TransactionModel::AutoRollback)] procedure AccountsAppearOnThePageTest() var - EmailAccount: Record "Email Account"; + TempEmailAccount: Record "Email Account"; ConnectorMock: Codeunit "Connector Mock"; AccountsPage: TestPage "Email Accounts"; begin @@ -34,7 +34,7 @@ codeunit 134686 "Email Accounts Test" // [Given] A email account ConnectorMock.Initialize(); - ConnectorMock.AddAccount(EmailAccount); + ConnectorMock.AddAccount(TempEmailAccount); PermissionsMock.Set('Email Edit'); @@ -42,10 +42,10 @@ codeunit 134686 "Email Accounts Test" AccountsPage.OpenView(); // [Then] The email entry is visible on the page, the Concurrency Limit is set to 3 by default, and the Email Rate Limit is set to 0 (no limit). - Assert.IsTrue(AccountsPage.GoToKey(EmailAccount."Account Id", EmailAccount.Connector), 'The email account should be on the page'); + Assert.IsTrue(AccountsPage.GoToKey(TempEmailAccount."Account Id", TempEmailAccount.Connector), 'The email account should be on the page'); - Assert.AreEqual(EmailAccount."Email Address", Format(AccountsPage.EmailAddress), 'The email address on the page is wrong'); - Assert.AreEqual(EmailAccount.Name, Format(AccountsPage.NameField), 'The account name on the page is wrong'); + Assert.AreEqual(TempEmailAccount."Email Address", Format(AccountsPage.EmailAddress), 'The email address on the page is wrong'); + Assert.AreEqual(TempEmailAccount.Name, Format(AccountsPage.NameField), 'The account name on the page is wrong'); Assert.AreEqual(3, AccountsPage.EmailConcurrencyLimit.AsInteger(), 'The email concurrency limit on the page is wrong'); Assert.AreEqual(0, AccountsPage.EmailRateLimit.AsInteger(), 'The email rate limit on the page is wrong'); end; @@ -56,7 +56,7 @@ codeunit 134686 "Email Accounts Test" [TransactionModel(TransactionModel::AutoRollback)] procedure TwoAccountsAppearOnThePageTest() var - FirstEmailAccount, SecondEmailAccount : Record "Email Account"; + TempFirstEmailAccount, TempSecondEmailAccount : Record "Email Account"; ConnectorMock: Codeunit "Connector Mock"; AccountsPage: TestPage "Email Accounts"; begin @@ -64,8 +64,8 @@ codeunit 134686 "Email Accounts Test" // [Given] Two email accounts ConnectorMock.Initialize(); - ConnectorMock.AddAccount(FirstEmailAccount); - ConnectorMock.AddAccount(SecondEmailAccount); + ConnectorMock.AddAccount(TempFirstEmailAccount); + ConnectorMock.AddAccount(TempSecondEmailAccount); PermissionsMock.Set('Email Edit'); @@ -73,35 +73,35 @@ codeunit 134686 "Email Accounts Test" AccountsPage.OpenView(); // [Then] The email entries are visible on the page, the Concurrency Limit is set to 3 by default, and the Email Rate Limit is set to 0 (no limit). - Assert.IsTrue(AccountsPage.GoToKey(FirstEmailAccount."Account Id", Enum::"Email Connector"::"Test Email Connector"), 'The first email account should be on the page'); - Assert.AreEqual(FirstEmailAccount."Email Address", Format(AccountsPage.EmailAddress), 'The first email address on the page is wrong'); - Assert.AreEqual(FirstEmailAccount.Name, Format(AccountsPage.NameField), 'The first account name on the page is wrong'); + Assert.IsTrue(AccountsPage.GoToKey(TempFirstEmailAccount."Account Id", Enum::"Email Connector"::"Test Email Connector"), 'The first email account should be on the page'); + Assert.AreEqual(TempFirstEmailAccount."Email Address", Format(AccountsPage.EmailAddress), 'The first email address on the page is wrong'); + Assert.AreEqual(TempFirstEmailAccount.Name, Format(AccountsPage.NameField), 'The first account name on the page is wrong'); Assert.AreEqual(3, AccountsPage.EmailConcurrencyLimit.AsInteger(), 'The email concurrency limit on the page is wrong'); Assert.AreEqual(0, AccountsPage.EmailRateLimit.AsInteger(), 'The email rate limit on the page is wrong'); - Assert.IsTrue(AccountsPage.GoToKey(SecondEmailAccount."Account Id", Enum::"Email Connector"::"Test Email Connector"), 'The second email account should be on the page'); - Assert.AreEqual(SecondEmailAccount."Email Address", Format(AccountsPage.EmailAddress), 'The second email address on the page is wrong'); - Assert.AreEqual(SecondEmailAccount.Name, Format(AccountsPage.NameField), 'The second account name on the page is wrong'); + Assert.IsTrue(AccountsPage.GoToKey(TempSecondEmailAccount."Account Id", Enum::"Email Connector"::"Test Email Connector"), 'The second email account should be on the page'); + Assert.AreEqual(TempSecondEmailAccount."Email Address", Format(AccountsPage.EmailAddress), 'The second email address on the page is wrong'); + Assert.AreEqual(TempSecondEmailAccount.Name, Format(AccountsPage.NameField), 'The second account name on the page is wrong'); Assert.AreEqual(3, AccountsPage.EmailConcurrencyLimit.AsInteger(), 'The email concurrency limit on the page is wrong'); Assert.AreEqual(0, AccountsPage.EmailRateLimit.AsInteger(), 'The email rate limit on the page is wrong'); // [When] The Email Rate Limit Wizard page is shown, the concurrency limit is changed to 5 - AccountsPage.GoToKey(FirstEmailAccount."Account Id", Enum::"Email Connector"::"Test Email Connector"); + AccountsPage.GoToKey(TempFirstEmailAccount."Account Id", Enum::"Email Connector"::"Test Email Connector"); AccountsPage.EmailConcurrencyLimit.Drilldown(); AccountsPage.Close(); AccountsPage.OpenNew(); // [Then] First email account concurrency limit is changed to 5 and the other field is not changed - Assert.IsTrue(AccountsPage.GoToKey(FirstEmailAccount."Account Id", Enum::"Email Connector"::"Test Email Connector"), 'The first email account should be on the page'); - Assert.AreEqual(FirstEmailAccount."Email Address", Format(AccountsPage.EmailAddress), 'The first email address on the page is wrong'); - Assert.AreEqual(FirstEmailAccount.Name, Format(AccountsPage.NameField), 'The first account name on the page is wrong'); + Assert.IsTrue(AccountsPage.GoToKey(TempFirstEmailAccount."Account Id", Enum::"Email Connector"::"Test Email Connector"), 'The first email account should be on the page'); + Assert.AreEqual(TempFirstEmailAccount."Email Address", Format(AccountsPage.EmailAddress), 'The first email address on the page is wrong'); + Assert.AreEqual(TempFirstEmailAccount.Name, Format(AccountsPage.NameField), 'The first account name on the page is wrong'); Assert.AreEqual(5, AccountsPage.EmailConcurrencyLimit.AsInteger(), 'The email concurrency limit on the page is wrong'); Assert.AreEqual(0, AccountsPage.EmailRateLimit.AsInteger(), 'The email rate limit on the page is wrong'); // [Then] Second email account concurrency limit is not changed - Assert.IsTrue(AccountsPage.GoToKey(SecondEmailAccount."Account Id", Enum::"Email Connector"::"Test Email Connector"), 'The second email account should be on the page'); - Assert.AreEqual(SecondEmailAccount."Email Address", Format(AccountsPage.EmailAddress), 'The second email address on the page is wrong'); - Assert.AreEqual(SecondEmailAccount.Name, Format(AccountsPage.NameField), 'The second account name on the page is wrong'); + Assert.IsTrue(AccountsPage.GoToKey(TempSecondEmailAccount."Account Id", Enum::"Email Connector"::"Test Email Connector"), 'The second email account should be on the page'); + Assert.AreEqual(TempSecondEmailAccount."Email Address", Format(AccountsPage.EmailAddress), 'The second email address on the page is wrong'); + Assert.AreEqual(TempSecondEmailAccount.Name, Format(AccountsPage.NameField), 'The second account name on the page is wrong'); Assert.AreEqual(3, AccountsPage.EmailConcurrencyLimit.AsInteger(), 'The email concurrency limit on the page is wrong'); Assert.AreEqual(0, AccountsPage.EmailRateLimit.AsInteger(), 'The email rate limit on the page is wrong'); end; @@ -112,7 +112,7 @@ codeunit 134686 "Email Accounts Test" [TransactionModel(TransactionModel::AutoRollback)] procedure ChangeCurrencyLimitOverRangeTest() var - EmailAccount: Record "Email Account"; + TempEmailAccount: Record "Email Account"; ConnectorMock: Codeunit "Connector Mock"; AccountsPage: TestPage "Email Accounts"; begin @@ -120,7 +120,7 @@ codeunit 134686 "Email Accounts Test" // [Given] A email account ConnectorMock.Initialize(); - ConnectorMock.AddAccount(EmailAccount); + ConnectorMock.AddAccount(TempEmailAccount); PermissionsMock.Set('Email Edit'); @@ -128,7 +128,7 @@ codeunit 134686 "Email Accounts Test" AccountsPage.OpenView(); // [Then] The email entry is visible on the page. Change the concurrency limit to a value over the range to check if the error is shown. - Assert.IsTrue(AccountsPage.GoToKey(EmailAccount."Account Id", EmailAccount.Connector), 'The email account should be on the page'); + Assert.IsTrue(AccountsPage.GoToKey(TempEmailAccount."Account Id", TempEmailAccount.Connector), 'The email account should be on the page'); AccountsPage.EmailConcurrencyLimit.Drilldown(); // [Then] The error is shown when the concurrency limit is set to 20 @@ -138,20 +138,20 @@ codeunit 134686 "Email Accounts Test" [TransactionModel(TransactionModel::AutoRollback)] procedure IsAccountRegisteredTest() var - EmailAccountRecord: Record "Email Account"; + TempEmailAccountRecord: Record "Email Account"; ConnectorMock: Codeunit "Connector Mock"; - EmailAccount: Codeunit "Email Account"; + TempEmailAccount: Codeunit "Email Account"; begin // [Scenario] When there's a email account for a connector, it should return true for IsAccountRegistered // [Given] An email account ConnectorMock.Initialize(); - ConnectorMock.AddAccount(EmailAccountRecord); + ConnectorMock.AddAccount(TempEmailAccountRecord); PermissionsMock.Set('Email Edit'); // [Then] The email account is registered - Assert.IsTrue(EmailAccount.IsAccountRegistered(EmailAccountRecord."Account Id", EmailAccountRecord.Connector), 'The email account should be registered'); + Assert.IsTrue(TempEmailAccount.IsAccountRegistered(TempEmailAccountRecord."Account Id", TempEmailAccountRecord.Connector), 'The email account should be registered'); end; [Test] @@ -284,9 +284,9 @@ codeunit 134686 "Email Accounts Test" [Test] procedure GetAllAccountsTest() var - EmailAccountBuffer, EmailAccounts : Record "Email Account"; + TempEmailAccountBuffer, TempEmailAccounts : Record "Email Account"; ConnectorMock: Codeunit "Connector Mock"; - EmailAccount: Codeunit "Email Account"; + TempEmailAccount: Codeunit "Email Account"; begin // [SCENARIO] GetAllAccounts retrieves all the registered accounts @@ -296,31 +296,31 @@ codeunit 134686 "Email Accounts Test" PermissionsMock.Set('Email Edit'); // [WHEN] GetAllAccounts is called - EmailAccount.GetAllAccounts(EmailAccounts); + TempEmailAccount.GetAllAccounts(TempEmailAccounts); // [THEN] The returned record is empty (there are no registered accounts) - Assert.IsTrue(EmailAccounts.IsEmpty(), 'Record should be empty'); + Assert.IsTrue(TempEmailAccounts.IsEmpty(), 'Record should be empty'); // [GIVEN] An account is added to the connector - ConnectorMock.AddAccount(EmailAccountBuffer); + ConnectorMock.AddAccount(TempEmailAccountBuffer); // [WHEN] GetAllAccounts is called - EmailAccount.GetAllAccounts(EmailAccounts); + TempEmailAccount.GetAllAccounts(TempEmailAccounts); // [THEN] The returned record is not empty and the values are as expected - Assert.AreEqual(1, EmailAccounts.Count(), 'Record should not be empty'); - EmailAccounts.FindFirst(); - Assert.AreEqual(EmailAccountBuffer."Account Id", EmailAccounts."Account Id", 'Wrong account ID'); - Assert.AreEqual(Enum::"Email Connector"::"Test Email Connector", EmailAccounts.Connector, 'Wrong connector'); - Assert.AreEqual(EmailAccountBuffer.Name, EmailAccounts.Name, 'Wrong account name'); - Assert.AreEqual(EmailAccountBuffer."Email Address", EmailAccounts."Email Address", 'Wrong account email address'); + Assert.AreEqual(1, TempEmailAccounts.Count(), 'Record should not be empty'); + TempEmailAccounts.FindFirst(); + Assert.AreEqual(TempEmailAccountBuffer."Account Id", TempEmailAccounts."Account Id", 'Wrong account ID'); + Assert.AreEqual(Enum::"Email Connector"::"Test Email Connector", TempEmailAccounts.Connector, 'Wrong connector'); + Assert.AreEqual(TempEmailAccountBuffer.Name, TempEmailAccounts.Name, 'Wrong account name'); + Assert.AreEqual(TempEmailAccountBuffer."Email Address", TempEmailAccounts."Email Address", 'Wrong account email address'); end; [Test] procedure IsAnyAccountRegisteredTest() var ConnectorMock: Codeunit "Connector Mock"; - EmailAccount: Codeunit "Email Account"; + TempEmailAccount: Codeunit "Email Account"; AccountId: Guid; begin // [SCENARIO] Email Account Exists works as expected @@ -332,14 +332,14 @@ codeunit 134686 "Email Accounts Test" // [WHEN] Calling IsAnyAccountRegistered // [THEN] it evaluates to false - Assert.IsFalse(EmailAccount.IsAnyAccountRegistered(), 'There should be no registered accounts'); + Assert.IsFalse(TempEmailAccount.IsAnyAccountRegistered(), 'There should be no registered accounts'); // [WHEN] An email account is added ConnectorMock.AddAccount(AccountId); // [WHEN] Calling IsAnyAccountRegistered // [THEN] it evaluates to true - Assert.IsTrue(EmailAccount.IsAnyAccountRegistered(), 'There should be a registered account'); + Assert.IsTrue(TempEmailAccount.IsAnyAccountRegistered(), 'There should be a registered account'); end; [Test] @@ -451,7 +451,7 @@ codeunit 134686 "Email Accounts Test" [HandlerFunctions('ConfirmYesHandler')] procedure DeleteNonDefaultAccountTest() var - SecondAccount: Record "Email Account"; + TempSecondAccount: Record "Email Account"; ConnectorMock: Codeunit "Connector Mock"; EmailAccountsSelectionMock: Codeunit "Email Accounts Selection Mock"; EmailScenario: Codeunit "Email Scenario"; @@ -464,11 +464,11 @@ codeunit 134686 "Email Accounts Test" // [GIVEN] A connector is installed and three account are added ConnectorMock.Initialize(); ConnectorMock.AddAccount(FirstAccountId); - ConnectorMock.AddAccount(SecondAccount); + ConnectorMock.AddAccount(TempSecondAccount); ConnectorMock.AddAccount(ThirdAccountId); // [GIVEN] The second account is set as default - EmailScenario.SetDefaultEmailAccount(SecondAccount); + EmailScenario.SetDefaultEmailAccount(TempSecondAccount); // [WHEN] Open the Email Accounts page EmailAccountsTestPage.OpenView(); @@ -483,7 +483,7 @@ codeunit 134686 "Email Accounts Test" // [THEN] The deleted accounts are not on the page, the non-deleted accounts are on the page. Assert.IsFalse(EmailAccountsTestPage.GoToKey(FirstAccountId, Enum::"Email Connector"::"Test Email Connector"), 'The first email account should not be on the page'); - Assert.IsTrue(EmailAccountsTestPage.GoToKey(SecondAccount."Account Id", Enum::"Email Connector"::"Test Email Connector"), 'The second email account should be on the page'); + Assert.IsTrue(EmailAccountsTestPage.GoToKey(TempSecondAccount."Account Id", Enum::"Email Connector"::"Test Email Connector"), 'The second email account should be on the page'); Assert.IsTrue(GetDefaultFieldValueAsBoolean(EmailAccountsTestPage.DefaultField.Value), 'The second account should be marked as default'); Assert.IsTrue(EmailAccountsTestPage.GoToKey(ThirdAccountId, Enum::"Email Connector"::"Test Email Connector"), 'The third email account should be on the page'); @@ -494,7 +494,7 @@ codeunit 134686 "Email Accounts Test" [HandlerFunctions('ConfirmYesHandler')] procedure DeleteDefaultAccountTest() var - SecondAccount: Record "Email Account"; + TempSecondAccount: Record "Email Account"; ConnectorMock: Codeunit "Connector Mock"; EmailAccountsSelectionMock: Codeunit "Email Accounts Selection Mock"; EmailScenario: Codeunit "Email Scenario"; @@ -507,18 +507,18 @@ codeunit 134686 "Email Accounts Test" // [GIVEN] A connector is installed and three account are added ConnectorMock.Initialize(); ConnectorMock.AddAccount(FirstAccountId); - ConnectorMock.AddAccount(SecondAccount); + ConnectorMock.AddAccount(TempSecondAccount); ConnectorMock.AddAccount(ThirdAccountId); // [GIVEN] The second account is set as default - EmailScenario.SetDefaultEmailAccount(SecondAccount); + EmailScenario.SetDefaultEmailAccount(TempSecondAccount); // [WHEN] Open the Email Accounts page EmailAccountsTestPage.OpenView(); // [WHEN] Select accounts including the default one BindSubscription(EmailAccountsSelectionMock); - EmailAccountsSelectionMock.SelectAccount(SecondAccount."Account Id"); + EmailAccountsSelectionMock.SelectAccount(TempSecondAccount."Account Id"); EmailAccountsSelectionMock.SelectAccount(ThirdAccountId); // [WHEN] Delete action is invoked and the action is confirmed (see ConfirmYesHandler) @@ -528,7 +528,7 @@ codeunit 134686 "Email Accounts Test" Assert.IsTrue(EmailAccountsTestPage.GoToKey(FirstAccountId, Enum::"Email Connector"::"Test Email Connector"), 'The first email account should be on the page'); Assert.IsTrue(GetDefaultFieldValueAsBoolean(EmailAccountsTestPage.DefaultField.Value), 'The first account should be marked as default'); - Assert.IsFalse(EmailAccountsTestPage.GoToKey(SecondAccount."Account Id", Enum::"Email Connector"::"Test Email Connector"), 'The second email account should not be on the page'); + Assert.IsFalse(EmailAccountsTestPage.GoToKey(TempSecondAccount."Account Id", Enum::"Email Connector"::"Test Email Connector"), 'The second email account should not be on the page'); Assert.IsFalse(EmailAccountsTestPage.GoToKey(ThirdAccountId, Enum::"Email Connector"::"Test Email Connector"), 'The third email account should not be on the page'); end; @@ -536,7 +536,7 @@ codeunit 134686 "Email Accounts Test" [HandlerFunctions('ConfirmYesHandler,ChooseNewDefaultAccountCancelHandler')] procedure DeleteDefaultAccountPromptNewAccountCancelTest() var - SecondAccount: Record "Email Account"; + TempSecondAccount: Record "Email Account"; ConnectorMock: Codeunit "Connector Mock"; EmailAccountsSelectionMock: Codeunit "Email Accounts Selection Mock"; EmailScenario: Codeunit "Email Scenario"; @@ -549,18 +549,18 @@ codeunit 134686 "Email Accounts Test" // [GIVEN] A connector is installed and three account are added ConnectorMock.Initialize(); ConnectorMock.AddAccount(FirstAccountId); - ConnectorMock.AddAccount(SecondAccount); + ConnectorMock.AddAccount(TempSecondAccount); ConnectorMock.AddAccount(ThirdAccountId); // [GIVEN] The second account is set as default - EmailScenario.SetDefaultEmailAccount(SecondAccount); + EmailScenario.SetDefaultEmailAccount(TempSecondAccount); // [WHEN] Open the Email Accounts page EmailAccountsTestPage.OpenView(); // [WHEN] Select the default account BindSubscription(EmailAccountsSelectionMock); - EmailAccountsSelectionMock.SelectAccount(SecondAccount."Account Id"); + EmailAccountsSelectionMock.SelectAccount(TempSecondAccount."Account Id"); // [WHEN] Delete action is invoked and the action is confirmed (see ConfirmYesHandler) AccountToSelect := ThirdAccountId; // The third account is selected as the new default account @@ -570,7 +570,7 @@ codeunit 134686 "Email Accounts Test" Assert.IsTrue(EmailAccountsTestPage.GoToKey(FirstAccountId, Enum::"Email Connector"::"Test Email Connector"), 'The first email account should be on the page'); Assert.IsFalse(GetDefaultFieldValueAsBoolean(EmailAccountsTestPage.DefaultField.Value), 'The third account should not be marked as default'); - Assert.IsFalse(EmailAccountsTestPage.GoToKey(SecondAccount."Account Id", Enum::"Email Connector"::"Test Email Connector"), 'The second email account should not be on the page'); + Assert.IsFalse(EmailAccountsTestPage.GoToKey(TempSecondAccount."Account Id", Enum::"Email Connector"::"Test Email Connector"), 'The second email account should not be on the page'); Assert.IsTrue(EmailAccountsTestPage.GoToKey(ThirdAccountId, Enum::"Email Connector"::"Test Email Connector"), 'The third email account should be on the page'); Assert.IsFalse(GetDefaultFieldValueAsBoolean(EmailAccountsTestPage.DefaultField.Value), 'The third account should not be marked as default'); @@ -580,7 +580,7 @@ codeunit 134686 "Email Accounts Test" [HandlerFunctions('ConfirmYesHandler,ChooseNewDefaultAccountHandler')] procedure DeleteDefaultAccountPromptNewAccountTest() var - SecondAccount: Record "Email Account"; + TempSecondAccount: Record "Email Account"; ConnectorMock: Codeunit "Connector Mock"; EmailAccountsSelectionMock: Codeunit "Email Accounts Selection Mock"; EmailScenario: Codeunit "Email Scenario"; @@ -593,18 +593,18 @@ codeunit 134686 "Email Accounts Test" // [GIVEN] A connector is installed and three account are added ConnectorMock.Initialize(); ConnectorMock.AddAccount(FirstAccountId); - ConnectorMock.AddAccount(SecondAccount); + ConnectorMock.AddAccount(TempSecondAccount); ConnectorMock.AddAccount(ThirdAccountId); // [GIVEN] The second account is set as default - EmailScenario.SetDefaultEmailAccount(SecondAccount); + EmailScenario.SetDefaultEmailAccount(TempSecondAccount); // [WHEN] Open the Email Accounts page EmailAccountsTestPage.OpenView(); // [WHEN] Select the default account BindSubscription(EmailAccountsSelectionMock); - EmailAccountsSelectionMock.SelectAccount(SecondAccount."Account Id"); + EmailAccountsSelectionMock.SelectAccount(TempSecondAccount."Account Id"); // [WHEN] Delete action is invoked and the action is confirmed (see ConfirmYesHandler) AccountToSelect := ThirdAccountId; // The third account is selected as the new default account @@ -614,7 +614,7 @@ codeunit 134686 "Email Accounts Test" Assert.IsTrue(EmailAccountsTestPage.GoToKey(FirstAccountId, Enum::"Email Connector"::"Test Email Connector"), 'The first email account should be on the page'); Assert.IsFalse(GetDefaultFieldValueAsBoolean(EmailAccountsTestPage.DefaultField.Value), 'The first account should not be marked as default'); - Assert.IsFalse(EmailAccountsTestPage.GoToKey(SecondAccount."Account Id", Enum::"Email Connector"::"Test Email Connector"), 'The second email account should not be on the page'); + Assert.IsFalse(EmailAccountsTestPage.GoToKey(TempSecondAccount."Account Id", Enum::"Email Connector"::"Test Email Connector"), 'The second email account should not be on the page'); Assert.IsTrue(EmailAccountsTestPage.GoToKey(ThirdAccountId, Enum::"Email Connector"::"Test Email Connector"), 'The third email account should be on the page'); Assert.IsTrue(GetDefaultFieldValueAsBoolean(EmailAccountsTestPage.DefaultField.Value), 'The third account should be marked as default'); @@ -626,7 +626,7 @@ codeunit 134686 "Email Accounts Test" TempEmailAccount: Record "Email Account" temporary; TempEmailAccountToDelete: Record "Email Account" temporary; ConnectorMock: Codeunit "Connector Mock"; - EmailAccount: Codeunit "Email Account"; + EmailAccountMgt: Codeunit "Email Account"; FirstAccountId, SecondAccountId : Guid; begin // [SCENARIO] When all accounts are deleted, the Email Accounts page is empty @@ -638,15 +638,15 @@ codeunit 134686 "Email Accounts Test" ConnectorMock.AddAccount(SecondAccountId); // [GIVEN] Mark first account for deletion - EmailAccount.GetAllAccounts(TempEmailAccountToDelete); + EmailAccountMgt.GetAllAccounts(TempEmailAccountToDelete); Assert.AreEqual(2, TempEmailAccountToDelete.Count(), 'Expected to have 2 accounts.'); TempEmailAccountToDelete.SetRange("Account Id", FirstAccountId); // [WHEN] Email Accounts are deleted - EmailAccount.DeleteAccounts(TempEmailAccountToDelete, true); + EmailAccountMgt.DeleteAccounts(TempEmailAccountToDelete, true); // [THEN] Verify second account still exists - EmailAccount.GetAllAccounts(TempEmailAccount); + EmailAccountMgt.GetAllAccounts(TempEmailAccount); Assert.AreEqual(1, TempEmailAccount.Count(), 'Expected to have 1 account.'); TempEmailAccount.FindFirst(); Assert.AreEqual(SecondAccountId, TempEmailAccount."Account Id", 'The second email account should still exist.'); diff --git a/src/System Application/Test/Email/src/EmailAddressLookupTests.Codeunit.al b/src/System Application/Test/Email/src/EmailAddressLookupTests.Codeunit.al index 69d571272b..92dbdef24a 100644 --- a/src/System Application/Test/Email/src/EmailAddressLookupTests.Codeunit.al +++ b/src/System Application/Test/Email/src/EmailAddressLookupTests.Codeunit.al @@ -26,7 +26,7 @@ codeunit 134699 "Email Address Lookup Tests" [HandlerFunctions('EmailRecipientLookupHandler')] procedure EmailAddresssLookupTest() var - EmailAccount: Record "Email Account"; + TempEmailAccount: Record "Email Account"; SentEmail: Record "Sent Email"; Outbox: Record "Email Outbox"; ConnectorMock: Codeunit "Connector Mock"; @@ -44,7 +44,7 @@ codeunit 134699 "Email Address Lookup Tests" Outbox.DeleteAll(); SentEmail.DeleteAll(); ConnectorMock.Initialize(); - ConnectorMock.AddAccount(EmailAccount); + ConnectorMock.AddAccount(TempEmailAccount); BindSubscription(EmailAccConnMock); BindSubscription(EmailAddressLookupMock); PermissionsMock.Set('Email Edit'); @@ -55,7 +55,7 @@ codeunit 134699 "Email Address Lookup Tests" // [WHEN] Opening the email message in the email editor and performing a Lookup on ToRecipient field EditorPage.Trap(); - Email.OpenInEditor(Message, EmailAccount); + Email.OpenInEditor(Message, TempEmailAccount); EditorPage.ToField.Lookup(); @@ -86,8 +86,8 @@ codeunit 134699 "Email Address Lookup Tests" SentEmail.SetRange("Message Id", Message.GetId()); Assert.IsTrue(SentEmail.FindFirst(), 'A Sent Email record should have been inserted.'); Assert.AreEqual('Test Subject', SentEmail.Description, 'The email subject should be "Subject"'); - Assert.AreEqual(EmailAccount."Account Id", SentEmail."Account Id", 'A different account was expected'); - Assert.AreEqual(EmailAccount."Email Address", SentEmail."Sent From", 'A different sent from was expected'); + Assert.AreEqual(TempEmailAccount."Account Id", SentEmail."Account Id", 'A different account was expected'); + Assert.AreEqual(TempEmailAccount."Email Address", SentEmail."Sent From", 'A different sent from was expected'); Assert.AreEqual(Enum::"Email Connector"::"Test Email Connector", SentEmail.Connector, 'A different connector was expected'); Message.GetRecipients(Enum::"Email Recipient Type"::"To", Recipients); @@ -115,7 +115,7 @@ codeunit 134699 "Email Address Lookup Tests" [HandlerFunctions('EmailRecipientLookupCancelHandler')] procedure EmailAddressLookupCancelTest() var - EmailAccount: Record "Email Account"; + TempEmailAccount: Record "Email Account"; SentEmail: Record "Sent Email"; Outbox: Record "Email Outbox"; ConnectorMock: Codeunit "Connector Mock"; @@ -131,7 +131,7 @@ codeunit 134699 "Email Address Lookup Tests" Outbox.DeleteAll(); SentEmail.DeleteAll(); ConnectorMock.Initialize(); - ConnectorMock.AddAccount(EmailAccount); + ConnectorMock.AddAccount(TempEmailAccount); BindSubscription(EmailAccConnMock); BindSubscription(EmailAddressLookupMock); PermissionsMock.Set('Email Edit'); @@ -142,7 +142,7 @@ codeunit 134699 "Email Address Lookup Tests" // [WHEN] Opening the email message in the email editor and performing a Lookup on ToRecipient field EditorPage.Trap(); - Email.OpenInEditor(Message, EmailAccount); + Email.OpenInEditor(Message, TempEmailAccount); EditorPage.ToField.Lookup(); @@ -162,7 +162,7 @@ codeunit 134699 "Email Address Lookup Tests" var SentEmail: Record "Sent Email"; Outbox: Record "Email Outbox"; - EmailAccount: Record "Email Account"; + TempEmailAccount: Record "Email Account"; ConnectorMock: Codeunit "Connector Mock"; Message: Codeunit "Email Message"; Email: Codeunit Email; @@ -176,7 +176,7 @@ codeunit 134699 "Email Address Lookup Tests" Outbox.DeleteAll(); SentEmail.DeleteAll(); ConnectorMock.Initialize(); - ConnectorMock.AddAccount(EmailAccount); + ConnectorMock.AddAccount(TempEmailAccount); BindSubscription(EmailAccConnMock); BindSubscription(EmailAddressLookupMock); PermissionsMock.Set('Email Edit'); @@ -187,7 +187,7 @@ codeunit 134699 "Email Address Lookup Tests" // [WHEN] Opening the email message in the email editor and performing a Lookup on ToRecipient field EditorPage.Trap(); - Email.OpenInEditor(Message, EmailAccount); + Email.OpenInEditor(Message, TempEmailAccount); EditorPage.ToField.Lookup(); diff --git a/src/System Application/Test/Email/src/EmailDefaultAttachmentTests.Codeunit.al b/src/System Application/Test/Email/src/EmailDefaultAttachmentTests.Codeunit.al index 2a197d38b9..291c848b96 100644 --- a/src/System Application/Test/Email/src/EmailDefaultAttachmentTests.Codeunit.al +++ b/src/System Application/Test/Email/src/EmailDefaultAttachmentTests.Codeunit.al @@ -32,8 +32,8 @@ codeunit 134853 "Email Default Attachment Tests" [Scope('OnPrem')] procedure SetUpEmailScenarioWithNoAttachments() var - EmailAccount: Record "Email Account"; - EmailAttachment: Record "Email Attachments"; + TempEmailAccount: Record "Email Account"; + TempEmailAttachment: Record "Email Attachments"; EmailScenarioAttachment: Record "Email Scenario Attachments"; TempBLob: Codeunit "Temp Blob"; AccountId: Guid; @@ -51,17 +51,17 @@ codeunit 134853 "Email Default Attachment Tests" // [When] calling GetEmailAccount // [Then] true is returned and the email account is as expected - Assert.IsTrue(EmailScenario.GetEmailAccount(Enum::"Email Scenario"::"Test Email Scenario", EmailAccount), 'There should be an email account'); - Assert.AreEqual(AccountId, EmailAccount."Account Id", 'Wrong account ID'); - Assert.AreEqual(Enum::"Email Connector"::"Test Email Connector", EmailAccount.Connector, 'Wrong connector'); + Assert.IsTrue(EmailScenario.GetEmailAccount(Enum::"Email Scenario"::"Test Email Scenario", TempEmailAccount), 'There should be an email account'); + Assert.AreEqual(AccountId, TempEmailAccount."Account Id", 'Wrong account ID'); + Assert.AreEqual(Enum::"Email Connector"::"Test Email Connector", TempEmailAccount.Connector, 'Wrong connector'); // [Then] the Email Scenario Attachments table should be empty Assert.IsTrue(EmailScenarioAttachment.IsEmpty(), 'The Email Scenario Attachment should be empty'); // [When] calling GetEmailAttachmentsByEmailScenario // [Then] Get the Attachment and the number of the email attachment should be 0 - EmailScenarioAttachImpl.GetEmailAttachmentsByEmailScenarios(EmailAttachment, Enum::"Email Scenario"::"Test Email Scenario".AsInteger()); - Assert.AreEqual(EmailAttachment.Count(), 0, 'Wrong Attachment Number'); + EmailScenarioAttachImpl.GetEmailAttachmentsByEmailScenarios(TempEmailAttachment, Enum::"Email Scenario"::"Test Email Scenario".AsInteger()); + Assert.AreEqual(TempEmailAttachment.Count(), 0, 'Wrong Attachment Number'); end; @@ -69,9 +69,9 @@ codeunit 134853 "Email Default Attachment Tests" [Scope('OnPrem')] procedure SetTwoEmailAttachmentsWithOneDefault() var - EmailAccount: Record "Email Account"; + TempEmailAccount: Record "Email Account"; EmailScenarioAttachments: Record "Email Scenario Attachments"; - EmailAttachments: Record "Email Attachments"; + TempEmailAttachments: Record "Email Attachments"; Document: Codeunit "Temp Blob"; AccountId: Guid; OutStream: OutStream; @@ -93,17 +93,17 @@ codeunit 134853 "Email Default Attachment Tests" // [When] calling GetEmailAccount // [Then] true is returned and the email account is as expected - Assert.IsTrue(EmailScenario.GetEmailAccount(Enum::"Email Scenario"::"Test Email Scenario", EmailAccount), 'There should be an email account'); - Assert.AreEqual(AccountId, EmailAccount."Account Id", 'Wrong account ID'); - Assert.AreEqual(Enum::"Email Connector"::"Test Email Connector", EmailAccount.Connector, 'Wrong connector'); + Assert.IsTrue(EmailScenario.GetEmailAccount(Enum::"Email Scenario"::"Test Email Scenario", TempEmailAccount), 'There should be an email account'); + Assert.AreEqual(AccountId, TempEmailAccount."Account Id", 'Wrong account ID'); + Assert.AreEqual(Enum::"Email Connector"::"Test Email Connector", TempEmailAccount.Connector, 'Wrong connector'); // [Then] There should be two record in the EmailScenarioAttachments Table Assert.AreEqual(2, EmailScenarioAttachments.Count(), 'Wrong total attachment number'); // [When] calling GetEmailAttachmentsByEmailScenario // [Then] Get the default attachment and the number of the email attachment should be 1 and - EmailScenarioAttachImpl.GetEmailAttachmentsByEmailScenarios(EmailAttachments, Enum::"Email Scenario"::"Test Email Scenario".AsInteger()); - Assert.AreEqual(2, EmailAttachments.Count(), 'Wrong current attachment number'); + EmailScenarioAttachImpl.GetEmailAttachmentsByEmailScenarios(TempEmailAttachments, Enum::"Email Scenario"::"Test Email Scenario".AsInteger()); + Assert.AreEqual(2, TempEmailAttachments.Count(), 'Wrong current attachment number'); end; [Test] @@ -111,7 +111,7 @@ codeunit 134853 "Email Default Attachment Tests" procedure DefaultScenarioShowAllAttachments() var EmailScenarioAttachments: Record "Email Scenario Attachments"; - EmailAttachments: Record "Email Attachments"; + TempEmailAttachments: Record "Email Attachments"; Document: Codeunit "Temp Blob"; AccountId: Guid; DefaultAccountId: Guid; @@ -138,15 +138,15 @@ codeunit 134853 "Email Default Attachment Tests" // [When] calling GetEmailAttachmentsByEmailScenario // [Then] Get the attachment and the number of the email attachment should be 1 and with right status - EmailScenarioAttachImpl.GetEmailAttachmentsByEmailScenarios(EmailAttachments, Enum::"Email Scenario"::"Test Email Scenario".AsInteger()); - Assert.AreEqual(EmailAttachments.AttachmentDefaultStatus, false, 'The status of the attachment should be not default'); - Assert.AreEqual(1, EmailAttachments.Count(), 'Wrong current attachment number'); + EmailScenarioAttachImpl.GetEmailAttachmentsByEmailScenarios(TempEmailAttachments, Enum::"Email Scenario"::"Test Email Scenario".AsInteger()); + Assert.AreEqual(TempEmailAttachments.AttachmentDefaultStatus, false, 'The status of the attachment should be not default'); + Assert.AreEqual(1, TempEmailAttachments.Count(), 'Wrong current attachment number'); // [When] The default account have only default scenario. Calling GetEmailAttachmentsByEmailScenario // [Then] For default scenario, return all the attachment for all scenarios - EmailScenarioAttachImpl.GetEmailAttachmentsByEmailScenarios(EmailAttachments, Enum::"Email Scenario"::"Default".AsInteger()); - Assert.AreEqual(EmailAttachments.AttachmentDefaultStatus, false, 'The status of the attachment should be default'); - Assert.AreEqual(1, EmailAttachments.Count(), 'Wrong current attachment number'); + EmailScenarioAttachImpl.GetEmailAttachmentsByEmailScenarios(TempEmailAttachments, Enum::"Email Scenario"::"Default".AsInteger()); + Assert.AreEqual(TempEmailAttachments.AttachmentDefaultStatus, false, 'The status of the attachment should be default'); + Assert.AreEqual(1, TempEmailAttachments.Count(), 'Wrong current attachment number'); end; @@ -294,7 +294,7 @@ codeunit 134853 "Email Default Attachment Tests" procedure AddAttachment(AttachmentName: Text[250]; AttachmentInStream: InStream; Scenario: Enum "Email Scenario"; Status: Boolean) var EmailScenarioAttachments: Record "Email Scenario Attachments"; - // EmailAttachment: Record "Email Attachments"; + // TempEmailAttachment: Record "Email Attachments"; begin EmailScenarioAttachments."Attachment Name" := AttachmentName; EmailScenarioAttachments."Email Attachment".ImportStream(AttachmentInStream, AttachmentName); @@ -312,11 +312,11 @@ codeunit 134853 "Email Default Attachment Tests" local procedure Initialize() var - EmailAttachments: Record "Email Attachments"; + TempEmailAttachments: Record "Email Attachments"; EmailScenarioAttachments: Record "Email Scenario Attachments"; begin EmailScenarioMock.DeleteAllMappings(); - EmailAttachments.DeleteAll(); + TempEmailAttachments.DeleteAll(); EmailScenarioAttachments.DeleteAll(); end; } \ No newline at end of file diff --git a/src/System Application/Test/Email/src/EmailEditorValidationTests.Codeunit.al b/src/System Application/Test/Email/src/EmailEditorValidationTests.Codeunit.al index 7083e7acb8..755b9b061e 100644 --- a/src/System Application/Test/Email/src/EmailEditorValidationTests.Codeunit.al +++ b/src/System Application/Test/Email/src/EmailEditorValidationTests.Codeunit.al @@ -66,7 +66,7 @@ codeunit 134696 "Email Editor Validation Tests" [TransactionModel(TransactionModel::AutoRollback)] procedure SendNewMessageThroughEditorFailsNoToRecipient() var - EmailAccount: Record "Email Account"; + TempEmailAccount: Record "Email Account"; SentEmail: Record "Sent Email"; Outbox: Record "Email Outbox"; ConnectorMock: Codeunit "Connector Mock"; @@ -79,7 +79,7 @@ codeunit 134696 "Email Editor Validation Tests" Outbox.DeleteAll(); SentEmail.DeleteAll(); ConnectorMock.Initialize(); - ConnectorMock.AddAccount(EmailAccount); + ConnectorMock.AddAccount(TempEmailAccount); PermissionsMock.Set('Email Admin'); GiveUserViewAllPolicy(); @@ -107,7 +107,7 @@ codeunit 134696 "Email Editor Validation Tests" [TransactionModel(TransactionModel::AutoRollback)] procedure SendNewMessageThroughEditorFailsInvalidRecipients() var - EmailAccount: Record "Email Account"; + TempEmailAccount: Record "Email Account"; SentEmail: Record "Sent Email"; Outbox: Record "Email Outbox"; ConnectorMock: Codeunit "Connector Mock"; @@ -122,7 +122,7 @@ codeunit 134696 "Email Editor Validation Tests" Outbox.DeleteAll(); SentEmail.DeleteAll(); ConnectorMock.Initialize(); - ConnectorMock.AddAccount(EmailAccount); + ConnectorMock.AddAccount(TempEmailAccount); ValidEmailAddress := Any.Email(); InvalidEmailAddress := 'invalid email address'; @@ -196,7 +196,7 @@ codeunit 134696 "Email Editor Validation Tests" [TransactionModel(TransactionModel::AutoRollback)] procedure SendNewMessageThroughEditorNoSubjectTest() var - EmailAccount: Record "Email Account"; + TempEmailAccount: Record "Email Account"; SentEmail: Record "Sent Email"; Outbox: Record "Email Outbox"; ConnectorMock: Codeunit "Connector Mock"; @@ -210,7 +210,7 @@ codeunit 134696 "Email Editor Validation Tests" Outbox.DeleteAll(); SentEmail.DeleteAll(); ConnectorMock.Initialize(); - ConnectorMock.AddAccount(EmailAccount); + ConnectorMock.AddAccount(TempEmailAccount); ValidEmailAddress := Any.Email(); PermissionsMock.Set('Email Admin'); @@ -237,7 +237,7 @@ codeunit 134696 "Email Editor Validation Tests" [HandlerFunctions('EmailAccountLookUpHandler,SendWithoutSubjectHandler')] procedure SendNewMessageThroughEditorNoSubjectSendTest() var - EmailAccount: Record "Email Account"; + TempEmailAccount: Record "Email Account"; SentEmail: Record "Sent Email"; Outbox: Record "Email Outbox"; ConnectorMock: Codeunit "Connector Mock"; @@ -252,7 +252,7 @@ codeunit 134696 "Email Editor Validation Tests" Outbox.DeleteAll(); SentEmail.DeleteAll(); ConnectorMock.Initialize(); - ConnectorMock.AddAccount(EmailAccount); + ConnectorMock.AddAccount(TempEmailAccount); ValidEmailAddress := Any.Email(); PermissionsMock.Set('Email Admin'); @@ -273,8 +273,8 @@ codeunit 134696 "Email Editor Validation Tests" SentEmail.SetRange("Message Id", Message.GetId()); Assert.IsTrue(SentEmail.FindFirst(), 'A Sent Email record should have been inserted.'); Assert.AreEqual('', SentEmail.Description, 'The email subject should be empty'); - Assert.AreEqual(EmailAccount."Account Id", SentEmail."Account Id", 'A different account was expected'); - Assert.AreEqual(EmailAccount."Email Address", SentEmail."Sent From", 'A different sent from was expected'); + Assert.AreEqual(TempEmailAccount."Account Id", SentEmail."Account Id", 'A different account was expected'); + Assert.AreEqual(TempEmailAccount."Email Address", SentEmail."Sent From", 'A different sent from was expected'); Assert.AreEqual(Enum::"Email Connector"::"Test Email Connector", SentEmail.Connector, 'A different connector was expected'); RemoveViewPolicies(); @@ -366,7 +366,7 @@ codeunit 134696 "Email Editor Validation Tests" [HandlerFunctions('WordTemplateToBodyModalHandler')] procedure EmailEditorApplyWordTemplate() var - EmailAccount: Record "Email Account"; + TempEmailAccount: Record "Email Account"; TestEmailAccount: Record "Test Email Account"; ConnectorMock: Codeunit "Connector Mock"; WordTemplateCreator: Codeunit "Word Template Creator"; @@ -383,7 +383,7 @@ codeunit 134696 "Email Editor Validation Tests" // [GIVEN] A connector is installed, an account is added, and a template is created for the table id of the primary source ConnectorMock.Initialize(); - ConnectorMock.AddAccount(EmailAccount); + ConnectorMock.AddAccount(TempEmailAccount); PermissionsMock.Set('Email Word Template'); TableId := Database::"Test Email Account"; WordTemplateCreator.CreateWordTemplateWithMergeValues(TableId); @@ -412,7 +412,7 @@ codeunit 134696 "Email Editor Validation Tests" [HandlerFunctions('WordTemplateToBodyModalHandler')] procedure EmailEditorApplyWordTemplateForMultipleRelatedEntities() var - EmailAccount: Record "Email Account"; + TempEmailAccount: Record "Email Account"; TestEmailAccount: Record "Test Email Account"; ConnectorMock: Codeunit "Connector Mock"; WordTemplateCreator: Codeunit "Word Template Creator"; @@ -429,7 +429,7 @@ codeunit 134696 "Email Editor Validation Tests" // [GIVEN] A connector is installed, an account is added, and a template is created for the related table id ConnectorMock.Initialize(); - ConnectorMock.AddAccount(EmailAccount); + ConnectorMock.AddAccount(TempEmailAccount); PermissionsMock.Set('Email Word Template'); PrimaryTableId := Database::"Test Email Connector Setup"; RelatedTableId := Database::"Test Email Account"; @@ -470,7 +470,7 @@ codeunit 134696 "Email Editor Validation Tests" [HandlerFunctions('WordTemplateAttachmentModalHandler')] procedure EmailEditorAttachWordTemplate() var - EmailAccount: Record "Email Account"; + TempEmailAccount: Record "Email Account"; TestEmailAccount: Record "Test Email Account"; ConnectorMock: Codeunit "Connector Mock"; WordTemplateCreator: Codeunit "Word Template Creator"; @@ -488,7 +488,7 @@ codeunit 134696 "Email Editor Validation Tests" // [GIVEN] A connector is installed, an account is added, and a template is created for the table id of the primary source ConnectorMock.Initialize(); - ConnectorMock.AddAccount(EmailAccount); + ConnectorMock.AddAccount(TempEmailAccount); PermissionsMock.Set('Email Word Template'); TableId := Database::"Test Email Account"; WordTemplateCreator.CreateWordTemplateWithMergeValues(TableId); @@ -521,7 +521,7 @@ codeunit 134696 "Email Editor Validation Tests" [HandlerFunctions('WordTemplateAttachmentModalHandler')] procedure EmailEditorAttachWordTemplateForMultipleRelatedEntities() var - EmailAccount: Record "Email Account"; + TempEmailAccount: Record "Email Account"; TestEmailAccount: Record "Test Email Account"; ConnectorMock: Codeunit "Connector Mock"; WordTemplateCreator: Codeunit "Word Template Creator"; @@ -539,7 +539,7 @@ codeunit 134696 "Email Editor Validation Tests" // [GIVEN] A connector is installed, an account is added, and a template is created for the related table id ConnectorMock.Initialize(); - ConnectorMock.AddAccount(EmailAccount); + ConnectorMock.AddAccount(TempEmailAccount); PermissionsMock.Set('Email Word Template'); PrimaryTableId := Database::"Test Email Connector Setup"; RelatedTableId := Database::"Test Email Account"; @@ -584,7 +584,7 @@ codeunit 134696 "Email Editor Validation Tests" [HandlerFunctions('ValidateDraftDefaultOptionEmailEditorHandler')] procedure EmailEditorCloseDefaultDraft() var - EmailAccount: Record "Email Account"; + TempEmailAccount: Record "Email Account"; EmailOutbox: Record "Email Outbox"; Email: Codeunit Email; ConnectorMock: Codeunit "Connector Mock"; @@ -596,7 +596,7 @@ codeunit 134696 "Email Editor Validation Tests" // [GIVEN] All outbox records are deleted, connector is installed and an account is added. EmailOutbox.DeleteAll(); ConnectorMock.Initialize(); - ConnectorMock.AddAccount(EmailAccount); + ConnectorMock.AddAccount(TempEmailAccount); // [GIVEN] Default exit parameter is draft (1) EmailEditorValues.SetDefaultExitOption(1); @@ -605,7 +605,7 @@ codeunit 134696 "Email Editor Validation Tests" EmailMessage.Create(Any.Email(), Any.UnicodeText(50), Any.UnicodeText(250), true); EmailMessageImpl.Get(EmailMessage.GetId()); EmailEditorTest.Trap(); - Email.OpenInEditor(EmailMessage, EmailAccount); + Email.OpenInEditor(EmailMessage, TempEmailAccount); // [WHEN] Editor is closed, the email is discarded EmailEditorTest.Close(); @@ -618,7 +618,7 @@ codeunit 134696 "Email Editor Validation Tests" [HandlerFunctions('ValidateDiscardDefaultOptionEmailEditorHandler')] procedure EmailEditorCloseDefaultDiscard() var - EmailAccount: Record "Email Account"; + TempEmailAccount: Record "Email Account"; EmailOutbox: Record "Email Outbox"; Email: Codeunit Email; ConnectorMock: Codeunit "Connector Mock"; @@ -630,7 +630,7 @@ codeunit 134696 "Email Editor Validation Tests" // [GIVEN] All outbox records are deleted, connector is installed and an account is added. EmailOutbox.DeleteAll(); ConnectorMock.Initialize(); - ConnectorMock.AddAccount(EmailAccount); + ConnectorMock.AddAccount(TempEmailAccount); // [GIVEN] Default exit parameter is discard (2) EmailEditorValues.SetDefaultExitOption(2); @@ -639,7 +639,7 @@ codeunit 134696 "Email Editor Validation Tests" EmailMessage.Create(Any.Email(), Any.UnicodeText(50), Any.UnicodeText(250), true); EmailMessageImpl.Get(EmailMessage.GetId()); EmailEditorTest.Trap(); - Email.OpenInEditor(EmailMessage, EmailAccount); + Email.OpenInEditor(EmailMessage, TempEmailAccount); // [WHEN] Editor is closed, the email is discarded EmailEditorTest.Close(); diff --git a/src/System Application/Test/Email/src/EmailRateLimitPageTest.Codeunit.al b/src/System Application/Test/Email/src/EmailRateLimitPageTest.Codeunit.al index 73b93945b6..bb1b78285d 100644 --- a/src/System Application/Test/Email/src/EmailRateLimitPageTest.Codeunit.al +++ b/src/System Application/Test/Email/src/EmailRateLimitPageTest.Codeunit.al @@ -25,7 +25,7 @@ codeunit 134705 "Email Rate Limit Page Test" [Scope('OnPrem')] procedure DefaultRateLimiteSendMultipleEmails() var - EmailAccount: Record "Email Account"; + TempEmailAccount: Record "Email Account"; EmailOutbox: Record "Email Outbox"; Email: Codeunit Email; EmailMessage: Codeunit "Email Message"; @@ -35,25 +35,25 @@ codeunit 134705 "Email Rate Limit Page Test" // [Given] One email account is registered ConnectorMock.Initialize(); - ConnectorMock.AddAccount(EmailAccount); + ConnectorMock.AddAccount(TempEmailAccount); // [Then] Send the first email, it should be sucessful CreateEmail(EmailMessage); Assert.IsTrue(EmailMessage.Get(EmailMessage.GetId()), 'The first email should exist'); - Assert.IsTrue(Email.Send(EmailMessage, EmailAccount), 'Sending one email should be successful'); + Assert.IsTrue(Email.Send(EmailMessage, TempEmailAccount), 'Sending one email should be successful'); // [Then] Send two emails, should be sucessful CreateEmail(EmailMessage); Assert.IsTrue(EmailMessage.Get(EmailMessage.GetId()), 'The second email should exist'); - Assert.IsTrue(Email.Send(EmailMessage, EmailAccount), 'Sending two emails should be successful'); + Assert.IsTrue(Email.Send(EmailMessage, TempEmailAccount), 'Sending two emails should be successful'); // [Then] Send three emails, should be sucessful CreateEmail(EmailMessage); Assert.IsTrue(EmailMessage.Get(EmailMessage.GetId()), 'The third email should exist'); - Assert.IsTrue(Email.Send(EmailMessage, EmailAccount), 'Sending three emails should be successful'); + Assert.IsTrue(Email.Send(EmailMessage, TempEmailAccount), 'Sending three emails should be successful'); // [Then] Check the email outbox, should be empty - EmailOutbox.SetRange("Account Id", EmailAccount."Account Id"); + EmailOutbox.SetRange("Account Id", TempEmailAccount."Account Id"); Assert.AreEqual(0, EmailOutbox.Count(), 'Email Outbox should be empty.'); end; @@ -61,7 +61,7 @@ codeunit 134705 "Email Rate Limit Page Test" [Scope('OnPrem')] procedure RateLimitEqualsOneSendTwoEmails() var - EmailAccount: Record "Email Account"; + TempEmailAccount: Record "Email Account"; EmailRateLimit: Record "Email Rate Limit"; EmailOutbox: Record "Email Outbox"; Email: Codeunit Email; @@ -72,28 +72,28 @@ codeunit 134705 "Email Rate Limit Page Test" // [Given] One email account is registered ConnectorMock.Initialize(); - ConnectorMock.AddAccount(EmailAccount); + ConnectorMock.AddAccount(TempEmailAccount); // [Then] Editing the rate limit, set the rate limit to 1 - EmailRateLimit.Get(EmailAccount."Account Id", EmailAccount.Connector); + EmailRateLimit.Get(TempEmailAccount."Account Id", TempEmailAccount.Connector); EmailRateLimit."Rate Limit" := 1; EmailRateLimit.Modify(); // [Then] Send the first email, it should be successful. The Outbox should be empty CreateEmail(EmailMessage); Assert.IsTrue(EmailMessage.Get(EmailMessage.GetId()), 'The email should exist'); - Assert.IsTrue(Email.Send(EmailMessage, EmailAccount), 'Sending an email should be successful'); + Assert.IsTrue(Email.Send(EmailMessage, TempEmailAccount), 'Sending an email should be successful'); - EmailOutbox.SetRange("Account Id", EmailAccount."Account Id"); + EmailOutbox.SetRange("Account Id", TempEmailAccount."Account Id"); Assert.AreEqual(0, EmailOutbox.Count(), 'Email Outbox should be empty.'); // [Then] Send the second email, it should succeed (and be rescheduled) CreateEmail(EmailMessage); Assert.IsTrue(EmailMessage.Get(EmailMessage.GetId()), 'The email should exist'); - Assert.IsTrue(Email.Send(EmailMessage, EmailAccount), 'Sending an email should be successful'); + Assert.IsTrue(Email.Send(EmailMessage, TempEmailAccount), 'Sending an email should be successful'); // [Then] Check the email outbox, there should be one rescheduled email. - EmailOutbox.SetRange("Account Id", EmailAccount."Account Id"); + EmailOutbox.SetRange("Account Id", TempEmailAccount."Account Id"); EmailOutbox.SetRange("Message Id", EmailMessage.GetId()); Assert.IsTrue(EmailOutbox.FindFirst(), 'The email outbox entry should exist'); diff --git a/src/System Application/Test/Email/src/EmailScenarioPageTest.Codeunit.al b/src/System Application/Test/Email/src/EmailScenarioPageTest.Codeunit.al index 924d66196d..202c9c223a 100644 --- a/src/System Application/Test/Email/src/EmailScenarioPageTest.Codeunit.al +++ b/src/System Application/Test/Email/src/EmailScenarioPageTest.Codeunit.al @@ -48,7 +48,7 @@ codeunit 134695 "Email Scenario Page Test" [TransactionModel(TransactionModel::AutoRollback)] procedure PageOpenOneEntryTest() var - EmailAccount: Record "Email Account"; + TempEmailAccount: Record "Email Account"; EmailScenarioPage: TestPage "Email Scenario Setup"; begin // [Scenario] The "Email Scenario Setup" shows one entry when there is only one email account and no scenarios @@ -56,7 +56,7 @@ codeunit 134695 "Email Scenario Page Test" // [Given] One email account is registered. ConnectorMock.Initialize(); - ConnectorMock.AddAccount(EmailAccount); + ConnectorMock.AddAccount(TempEmailAccount); // [When] Opening the the page EmailScenarioPage.Trap(); @@ -66,7 +66,7 @@ codeunit 134695 "Email Scenario Page Test" Assert.IsTrue(EmailScenarioPage.First(), 'There should be an entry on the page'); // Properties are as expected - Assert.AreEqual(StrSubstNo(DisplayNameTxt, EmailAccount.Name, EmailAccount."Email Address"), EmailScenarioPage.Name.Value, 'Wrong entry name'); + Assert.AreEqual(StrSubstNo(DisplayNameTxt, TempEmailAccount.Name, TempEmailAccount."Email Address"), EmailScenarioPage.Name.Value, 'Wrong entry name'); Assert.IsFalse(GetDefaultFieldValueAsBoolean(EmailScenarioPage.Default.Value), 'The account should not be marked as default'); // Actions visibility is as expected @@ -81,7 +81,7 @@ codeunit 134695 "Email Scenario Page Test" [Scope('OnPrem')] procedure PageOpenOneDefaultEntryTest() var - EmailAccount: Record "Email Account"; + TempEmailAccount: Record "Email Account"; EmailScenarioPage: TestPage "Email Scenario Setup"; begin // [Scenario] The "Email Scenario Setup" shows one entry when there is only one email account and no scenarios @@ -89,10 +89,10 @@ codeunit 134695 "Email Scenario Page Test" // [Given] One email account is registered and it's set as default. ConnectorMock.Initialize(); - ConnectorMock.AddAccount(EmailAccount); + ConnectorMock.AddAccount(TempEmailAccount); EmailScenarioMock.DeleteAllMappings(); - EmailScenarioMock.AddMapping(Enum::"Email Scenario"::Default, EmailAccount."Account Id", EmailAccount.Connector); + EmailScenarioMock.AddMapping(Enum::"Email Scenario"::Default, TempEmailAccount."Account Id", TempEmailAccount.Connector); // [When] Opening the the page EmailScenarioPage.Trap(); @@ -102,7 +102,7 @@ codeunit 134695 "Email Scenario Page Test" Assert.IsTrue(EmailScenarioPage.First(), 'There should be an entry on the page'); // Properties are as expected - Assert.AreEqual(StrSubstNo(DisplayNameTxt, EmailAccount.Name, EmailAccount."Email Address"), EmailScenarioPage.Name.Value, 'Wrong entry name'); + Assert.AreEqual(StrSubstNo(DisplayNameTxt, TempEmailAccount.Name, TempEmailAccount."Email Address"), EmailScenarioPage.Name.Value, 'Wrong entry name'); Assert.IsTrue(GetDefaultFieldValueAsBoolean(EmailScenarioPage.Default.Value), 'The account should be marked as default'); // Actions visibility is as expected @@ -119,7 +119,7 @@ codeunit 134695 "Email Scenario Page Test" [TransactionModel(TransactionModel::AutoRollback)] procedure PageOpenOneAcountsTwoScenariosTest() var - EmailAccount: Record "Email Account"; + TempEmailAccount: Record "Email Account"; EmailScenarioPage: TestPage "Email Scenario Setup"; begin // [Scenario] Having one default account with a non-default scenario assigned displays propely on "Email Scenario Setup" @@ -127,11 +127,11 @@ codeunit 134695 "Email Scenario Page Test" // [Given] One email account is registered and it's set as default. ConnectorMock.Initialize(); - ConnectorMock.AddAccount(EmailAccount); + ConnectorMock.AddAccount(TempEmailAccount); EmailScenarioMock.DeleteAllMappings(); - EmailScenarioMock.AddMapping(Enum::"Email Scenario"::Default, EmailAccount."Account Id", EmailAccount.Connector); - EmailScenarioMock.AddMapping(Enum::"Email Scenario"::"Test Email Scenario", EmailAccount."Account Id", EmailAccount.Connector); + EmailScenarioMock.AddMapping(Enum::"Email Scenario"::Default, TempEmailAccount."Account Id", TempEmailAccount.Connector); + EmailScenarioMock.AddMapping(Enum::"Email Scenario"::"Test Email Scenario", TempEmailAccount."Account Id", TempEmailAccount.Connector); // [When] Opening the the page EmailScenarioPage.Trap(); @@ -141,7 +141,7 @@ codeunit 134695 "Email Scenario Page Test" Assert.IsTrue(EmailScenarioPage.First(), 'There should be data on the page'); // Properties are as expected - Assert.AreEqual(StrSubstNo(DisplayNameTxt, EmailAccount.Name, EmailAccount."Email Address"), EmailScenarioPage.Name.Value, 'Wrong entry name'); + Assert.AreEqual(StrSubstNo(DisplayNameTxt, TempEmailAccount.Name, TempEmailAccount."Email Address"), EmailScenarioPage.Name.Value, 'Wrong entry name'); Assert.IsTrue(GetDefaultFieldValueAsBoolean(EmailScenarioPage.Default.Value), 'The account should be marked as default'); // Actions visibility is as expected @@ -167,7 +167,7 @@ codeunit 134695 "Email Scenario Page Test" [TransactionModel(TransactionModel::AutoRollback)] procedure PageOpenTwoAcountsTwoScenariosTest() var - FirstEmailAccount, SecondEmailAccount : Record "Email Account"; + TempFirstEmailAccount, TempSecondEmailAccount : Record "Email Account"; EmailScenarioPage: TestPage "Email Scenario Setup"; begin // [Scenario] The "Email Scenario Setup" shows three entries when there are two accounts - one with the default scenario and one with a non-default scenario @@ -175,24 +175,24 @@ codeunit 134695 "Email Scenario Page Test" // [Given] Two email accounts are registered. One is set as default. ConnectorMock.Initialize(); - ConnectorMock.AddAccount(FirstEmailAccount); - ConnectorMock.AddAccount(SecondEmailAccount); + ConnectorMock.AddAccount(TempFirstEmailAccount); + ConnectorMock.AddAccount(TempSecondEmailAccount); EmailScenarioMock.DeleteAllMappings(); - EmailScenarioMock.AddMapping(Enum::"Email Scenario"::Default, FirstEmailAccount."Account Id", FirstEmailAccount.Connector); - EmailScenarioMock.AddMapping(Enum::"Email Scenario"::"Test Email Scenario", SecondEmailAccount."Account Id", SecondEmailAccount.Connector); + EmailScenarioMock.AddMapping(Enum::"Email Scenario"::Default, TempFirstEmailAccount."Account Id", TempFirstEmailAccount.Connector); + EmailScenarioMock.AddMapping(Enum::"Email Scenario"::"Test Email Scenario", TempSecondEmailAccount."Account Id", TempSecondEmailAccount.Connector); // [When] Opening the the page EmailScenarioPage.Trap(); EmailScenarioPage.OpenView(); // [Then] There are three entries on the page. One is set as dedault - Assert.IsTrue(EmailScenarioPage.GoToKey(-1, FirstEmailAccount."Account Id", FirstEmailAccount.Connector), 'There should be data on the page'); - Assert.AreEqual(StrSubstNo(DisplayNameTxt, FirstEmailAccount.Name, FirstEmailAccount."Email Address"), EmailScenarioPage.Name.Value, 'Wrong first entry name'); + Assert.IsTrue(EmailScenarioPage.GoToKey(-1, TempFirstEmailAccount."Account Id", TempFirstEmailAccount.Connector), 'There should be data on the page'); + Assert.AreEqual(StrSubstNo(DisplayNameTxt, TempFirstEmailAccount.Name, TempFirstEmailAccount."Email Address"), EmailScenarioPage.Name.Value, 'Wrong first entry name'); Assert.IsTrue(GetDefaultFieldValueAsBoolean(EmailScenarioPage.Default.Value), 'The account should be marked as default'); - Assert.IsTrue(EmailScenarioPage.GoToKey(-1, SecondEmailAccount."Account Id", SecondEmailAccount.Connector), 'There should be another entry on the page'); - Assert.AreEqual(StrSubstNo(DisplayNameTxt, SecondEmailAccount.Name, SecondEmailAccount."Email Address"), EmailScenarioPage.Name.Value, 'Wrong second entry name'); + Assert.IsTrue(EmailScenarioPage.GoToKey(-1, TempSecondEmailAccount."Account Id", TempSecondEmailAccount.Connector), 'There should be another entry on the page'); + Assert.AreEqual(StrSubstNo(DisplayNameTxt, TempSecondEmailAccount.Name, TempSecondEmailAccount."Email Address"), EmailScenarioPage.Name.Value, 'Wrong second entry name'); Assert.IsFalse(GetDefaultFieldValueAsBoolean(EmailScenarioPage.Default.Value), 'The account should not be marked as default'); EmailScenarioPage.Expand(true); diff --git a/src/System Application/Test/Email/src/EmailScenarioTest.Codeunit.al b/src/System Application/Test/Email/src/EmailScenarioTest.Codeunit.al index 565363932d..ef01b4a2e8 100644 --- a/src/System Application/Test/Email/src/EmailScenarioTest.Codeunit.al +++ b/src/System Application/Test/Email/src/EmailScenarioTest.Codeunit.al @@ -27,7 +27,7 @@ codeunit 134693 "Email Scenario Test" [Scope('OnPrem')] procedure GetEmailAccountScenarioNotExistsTest() var - EmailAccount: Record "Email Account"; + TempEmailAccount: Record "Email Account"; begin // [Scenario] When the email scenario isn't mapped an email account, GetEmailAccount returns false PermissionsMock.Set('Email Admin'); @@ -37,14 +37,14 @@ codeunit 134693 "Email Scenario Test" // [When] calling GetEmailAccount // [Then] false is returned - Assert.IsFalse(EmailScenario.GetEmailAccount(Enum::"Email Scenario"::"Test Email Scenario", EmailAccount), 'There should not be any account'); + Assert.IsFalse(EmailScenario.GetEmailAccount(Enum::"Email Scenario"::"Test Email Scenario", TempEmailAccount), 'There should not be any account'); end; [Test] [Scope('OnPrem')] procedure GetEmailAccountNotExistsTest() var - EmailAccount: Record "Email Account"; + TempEmailAccount: Record "Email Account"; NonExistentAccountId: Guid; begin // [Scenario] When the email scenario is mapped non-existing email account, GetEmailAccount returns false @@ -57,14 +57,14 @@ codeunit 134693 "Email Scenario Test" // [When] calling GetEmailAccount // [Then] false is returned - Assert.IsFalse(EmailScenario.GetEmailAccount(Enum::"Email Scenario"::"Test Email Scenario", EmailAccount), 'There should not be any account mapped to the scenario'); + Assert.IsFalse(EmailScenario.GetEmailAccount(Enum::"Email Scenario"::"Test Email Scenario", TempEmailAccount), 'There should not be any account mapped to the scenario'); end; [Test] [Scope('OnPrem')] procedure GetEmailAccountDefaultNotExistsTest() var - EmailAccount: Record "Email Account"; + TempEmailAccount: Record "Email Account"; NonExistentAccountId: Guid; begin // [Scenario] When the default email scenario is mapped to a non-existing email account, GetEmailAccount returns false @@ -77,14 +77,14 @@ codeunit 134693 "Email Scenario Test" // [When] calling GetEmailAccount // [Then] false is returned - Assert.IsFalse(EmailScenario.GetEmailAccount(Enum::"Email Scenario"::"Test Email Scenario", EmailAccount), 'There should not be any account mapped to the scenario'); + Assert.IsFalse(EmailScenario.GetEmailAccount(Enum::"Email Scenario"::"Test Email Scenario", TempEmailAccount), 'There should not be any account mapped to the scenario'); end; [Test] [Scope('OnPrem')] procedure GetEmailAccountDefaultExistsTest() var - EmailAccount: Record "Email Account"; + TempEmailAccount: Record "Email Account"; AccountId: Guid; begin // [Scenario] When the default email scenario is mapped to an existing email account, GetEmailAccount returns that account @@ -97,9 +97,9 @@ codeunit 134693 "Email Scenario Test" // [When] calling GetEmailAccount // [Then] true is returned and the email account is as expected - Assert.IsTrue(EmailScenario.GetEmailAccount(Enum::"Email Scenario"::"Test Email Scenario", EmailAccount), 'There should be an email account'); - Assert.AreEqual(AccountId, EmailAccount."Account Id", 'Wrong account ID'); - Assert.AreEqual(Enum::"Email Connector"::"Test Email Connector", EmailAccount.Connector, 'Wrong connector'); + Assert.IsTrue(EmailScenario.GetEmailAccount(Enum::"Email Scenario"::"Test Email Scenario", TempEmailAccount), 'There should be an email account'); + Assert.AreEqual(AccountId, TempEmailAccount."Account Id", 'Wrong account ID'); + Assert.AreEqual(Enum::"Email Connector"::"Test Email Connector", TempEmailAccount.Connector, 'Wrong connector'); end; [Test] @@ -129,7 +129,7 @@ codeunit 134693 "Email Scenario Test" [Scope('OnPrem')] procedure GetEmailAccountExistsTest() var - EmailAccount: Record "Email Account"; + TempEmailAccount: Record "Email Account"; AccountId: Guid; begin // [Scenario] When the email scenario is mapped to an existing email account, GetEmailAccount returns that account @@ -142,16 +142,16 @@ codeunit 134693 "Email Scenario Test" // [When] calling GetEmailAccount // [Then] true is returned and the email account is as expected - Assert.IsTrue(EmailScenario.GetEmailAccount(Enum::"Email Scenario"::"Test Email Scenario", EmailAccount), 'There should be an email account'); - Assert.AreEqual(AccountId, EmailAccount."Account Id", 'Wrong account ID'); - Assert.AreEqual(Enum::"Email Connector"::"Test Email Connector", EmailAccount.Connector, 'Wrong connector'); + Assert.IsTrue(EmailScenario.GetEmailAccount(Enum::"Email Scenario"::"Test Email Scenario", TempEmailAccount), 'There should be an email account'); + Assert.AreEqual(AccountId, TempEmailAccount."Account Id", 'Wrong account ID'); + Assert.AreEqual(Enum::"Email Connector"::"Test Email Connector", TempEmailAccount.Connector, 'Wrong connector'); end; [Test] [Scope('OnPrem')] procedure GetEmailAccountDefaultDifferentTest() var - EmailAccount: Record "Email Account"; + TempEmailAccount: Record "Email Account"; AccountId: Guid; DefaultAccountId: Guid; begin @@ -167,20 +167,20 @@ codeunit 134693 "Email Scenario Test" // [When] calling GetEmailAccount // [Then] true is returned and the email accounts are as expected - Assert.IsTrue(EmailScenario.GetEmailAccount(Enum::"Email Scenario"::"Test Email Scenario", EmailAccount), 'There should be an email account'); - Assert.AreEqual(AccountId, EmailAccount."Account Id", 'Wrong account ID'); - Assert.AreEqual(Enum::"Email Connector"::"Test Email Connector", EmailAccount.Connector, 'Wrong connector'); + Assert.IsTrue(EmailScenario.GetEmailAccount(Enum::"Email Scenario"::"Test Email Scenario", TempEmailAccount), 'There should be an email account'); + Assert.AreEqual(AccountId, TempEmailAccount."Account Id", 'Wrong account ID'); + Assert.AreEqual(Enum::"Email Connector"::"Test Email Connector", TempEmailAccount.Connector, 'Wrong connector'); - Assert.IsTrue(EmailScenario.GetEmailAccount(Enum::"Email Scenario"::Default, EmailAccount), 'There should be an email account'); - Assert.AreEqual(DefaultAccountId, EmailAccount."Account Id", 'Wrong account ID'); - Assert.AreEqual(Enum::"Email Connector"::"Test Email Connector", EmailAccount.Connector, 'Wrong connector'); + Assert.IsTrue(EmailScenario.GetEmailAccount(Enum::"Email Scenario"::Default, TempEmailAccount), 'There should be an email account'); + Assert.AreEqual(DefaultAccountId, TempEmailAccount."Account Id", 'Wrong account ID'); + Assert.AreEqual(Enum::"Email Connector"::"Test Email Connector", TempEmailAccount.Connector, 'Wrong connector'); end; [Test] [Scope('OnPrem')] procedure GetEmailAccountDefaultDifferentNotExistTest() var - EmailAccount: Record "Email Account"; + TempEmailAccount: Record "Email Account"; NonExistingAccountId: Guid; DefaultAccountId: Guid; begin @@ -196,20 +196,20 @@ codeunit 134693 "Email Scenario Test" // [When] calling GetEmailAccount // [Then] true is returned and the email accounts are as expected - Assert.IsTrue(EmailScenario.GetEmailAccount(Enum::"Email Scenario"::"Test Email Scenario", EmailAccount), 'There should be an email account'); - Assert.AreEqual(DefaultAccountId, EmailAccount."Account Id", 'Wrong account ID'); - Assert.AreEqual(Enum::"Email Connector"::"Test Email Connector", EmailAccount.Connector, 'Wrong connector'); + Assert.IsTrue(EmailScenario.GetEmailAccount(Enum::"Email Scenario"::"Test Email Scenario", TempEmailAccount), 'There should be an email account'); + Assert.AreEqual(DefaultAccountId, TempEmailAccount."Account Id", 'Wrong account ID'); + Assert.AreEqual(Enum::"Email Connector"::"Test Email Connector", TempEmailAccount.Connector, 'Wrong connector'); - Assert.IsTrue(EmailScenario.GetEmailAccount(Enum::"Email Scenario"::Default, EmailAccount), 'There should be an email account for the default scenario'); - Assert.AreEqual(DefaultAccountId, EmailAccount."Account Id", 'Wrong default account ID'); - Assert.AreEqual(Enum::"Email Connector"::"Test Email Connector", EmailAccount.Connector, 'Wrong default account connector'); + Assert.IsTrue(EmailScenario.GetEmailAccount(Enum::"Email Scenario"::Default, TempEmailAccount), 'There should be an email account for the default scenario'); + Assert.AreEqual(DefaultAccountId, TempEmailAccount."Account Id", 'Wrong default account ID'); + Assert.AreEqual(Enum::"Email Connector"::"Test Email Connector", TempEmailAccount.Connector, 'Wrong default account connector'); end; [Test] [Scope('OnPrem')] procedure GetEmailAccountDifferentDefaultNotExistTest() var - EmailAccount: Record "Email Account"; + TempEmailAccount: Record "Email Account"; AccountId: Guid; DefaultAccountId: Guid; begin @@ -225,20 +225,20 @@ codeunit 134693 "Email Scenario Test" // [When] calling GetEmailAccount // [Then] true is returned and the email account is as expected - Assert.IsTrue(EmailScenario.GetEmailAccount(Enum::"Email Scenario"::"Test Email Scenario", EmailAccount), 'There should be an email account'); - Assert.AreEqual(AccountId, EmailAccount."Account Id", 'Wrong account ID'); - Assert.AreEqual(Enum::"Email Connector"::"Test Email Connector", EmailAccount.Connector, 'Wrong connector'); + Assert.IsTrue(EmailScenario.GetEmailAccount(Enum::"Email Scenario"::"Test Email Scenario", TempEmailAccount), 'There should be an email account'); + Assert.AreEqual(AccountId, TempEmailAccount."Account Id", 'Wrong account ID'); + Assert.AreEqual(Enum::"Email Connector"::"Test Email Connector", TempEmailAccount.Connector, 'Wrong connector'); // [Then] there's no account for the default email scenario - Assert.IsFalse(EmailScenario.GetEmailAccount(Enum::"Email Scenario"::Default, EmailAccount), 'There should not be an email account for the default scenario'); + Assert.IsFalse(EmailScenario.GetEmailAccount(Enum::"Email Scenario"::Default, TempEmailAccount), 'There should not be an email account for the default scenario'); end; [Test] [Scope('OnPrem')] procedure SetEmailAccountTest() var - EmailAccount: Record "Email Account"; - AnotherAccount: Record "Email Account"; + TempEmailAccount: Record "Email Account"; + TempAnotherAccount: Record "Email Account"; EmailScenarios: Record "Email Scenario"; Scenario: Enum "Email Scenario"; begin @@ -247,58 +247,58 @@ codeunit 134693 "Email Scenario Test" // [Given] A random email account Initialize(); - EmailAccount."Account Id" := Any.GuidValue(); - EmailAccount.Connector := Enum::"Email Connector"::"Test Email Connector"; + TempEmailAccount."Account Id" := Any.GuidValue(); + TempEmailAccount.Connector := Enum::"Email Connector"::"Test Email Connector"; Scenario := Scenario::Default; // [When] Setting the email account for the scenario - EmailScenario.SetEmailAccount(Scenario, EmailAccount); + EmailScenario.SetEmailAccount(Scenario, TempEmailAccount); // [Then] The scenario exists and is as expected Assert.IsTrue(EmailScenarios.Get(Scenario), 'The email scenario should exist'); - Assert.AreEqual(EmailScenarios."Account Id", EmailAccount."Account Id", 'Wrong accound ID'); - Assert.AreEqual(EmailScenarios.Connector, EmailAccount.Connector, 'Wrong connector'); + Assert.AreEqual(EmailScenarios."Account Id", TempEmailAccount."Account Id", 'Wrong accound ID'); + Assert.AreEqual(EmailScenarios.Connector, TempEmailAccount.Connector, 'Wrong connector'); - AnotherAccount."Account Id" := Any.GuidValue(); - AnotherAccount.Connector := Enum::"Email Connector"::"Test Email Connector"; + TempAnotherAccount."Account Id" := Any.GuidValue(); + TempAnotherAccount.Connector := Enum::"Email Connector"::"Test Email Connector"; // [When] Setting overwting the email account for the scenario - EmailScenario.SetEmailAccount(Scenario, AnotherAccount); + EmailScenario.SetEmailAccount(Scenario, TempAnotherAccount); // [Then] The scenario still exists and is as expected Assert.IsTrue(EmailScenarios.Get(Scenario), 'The email scenario should exist'); - Assert.AreEqual(EmailScenarios."Account Id", AnotherAccount."Account Id", 'Wrong accound ID'); - Assert.AreEqual(EmailScenarios.Connector, AnotherAccount.Connector, 'Wrong connector'); + Assert.AreEqual(EmailScenarios."Account Id", TempAnotherAccount."Account Id", 'Wrong accound ID'); + Assert.AreEqual(EmailScenarios.Connector, TempAnotherAccount.Connector, 'Wrong connector'); end; [Test] [Scope('OnPrem')] procedure UnassignScenarioTest() var - EmailAccount: Record "Email Account"; - DefaultAccount: Record "Email Account"; - ResultAccount: Record "Email Account"; + TempEmailAccount: Record "Email Account"; + TempDefaultAccount: Record "Email Account"; + TempResultAccount: Record "Email Account"; begin // [Scenario] When unassigning a scenario then it falls back to the default account. PermissionsMock.Set('Email Admin'); // [Given] Two accounts, one default and one not Initialize(); - ConnectorMock.AddAccount(EmailAccount); - ConnectorMock.AddAccount(DefaultAccount); - EmailScenario.SetDefaultEmailAccount(DefaultAccount); - EmailScenario.SetEmailAccount(Enum::"Email Scenario"::"Test Email Scenario", EmailAccount); + ConnectorMock.AddAccount(TempEmailAccount); + ConnectorMock.AddAccount(TempDefaultAccount); + EmailScenario.SetDefaultEmailAccount(TempDefaultAccount); + EmailScenario.SetEmailAccount(Enum::"Email Scenario"::"Test Email Scenario", TempEmailAccount); // mid-test verification - EmailScenario.GetEmailAccount(Enum::"Email Scenario"::"Test Email Scenario", ResultAccount); - Assert.AreEqual(EmailAccount."Account Id", ResultAccount."Account Id", 'Wrong account'); + EmailScenario.GetEmailAccount(Enum::"Email Scenario"::"Test Email Scenario", TempResultAccount); + Assert.AreEqual(TempEmailAccount."Account Id", TempResultAccount."Account Id", 'Wrong account'); // [When] Unassign the email scenario EmailScenario.UnassignScenario(Enum::"Email Scenario"::"Test Email Scenario"); // [Then] The default account is returned for that account - EmailScenario.GetEmailAccount(Enum::"Email Scenario"::"Test Email Scenario", ResultAccount); - Assert.AreEqual(DefaultAccount."Account Id", ResultAccount."Account Id", 'The default account should have been returned'); + EmailScenario.GetEmailAccount(Enum::"Email Scenario"::"Test Email Scenario", TempResultAccount); + Assert.AreEqual(TempDefaultAccount."Account Id", TempResultAccount."Account Id", 'The default account should have been returned'); end; local procedure Initialize() diff --git a/src/System Application/Test/Email/src/EmailTest.Codeunit.al b/src/System Application/Test/Email/src/EmailTest.Codeunit.al index 5542cd1485..597161cdfa 100644 --- a/src/System Application/Test/Email/src/EmailTest.Codeunit.al +++ b/src/System Application/Test/Email/src/EmailTest.Codeunit.al @@ -705,7 +705,7 @@ codeunit 134685 "Email Test" EmailOutbox: Record "Email Outbox"; EmailMessageAttachment: Record "Email Message Attachment"; SentEmail: Record "Sent Email"; - EmailAccount: Record "Email Account"; + TempEmailAccount: Record "Email Account"; EmailMessage: Codeunit "Email Message"; ConnectorMock: Codeunit "Connector Mock"; Connector: Enum "Email Connector"; @@ -720,25 +720,25 @@ codeunit 134685 "Email Test" Assert.IsTrue(EmailMessage.Get(EmailMessage.GetId()), 'The email should exist'); ConnectorMock.Initialize(); - ConnectorMock.AddAccount(EmailAccount); + ConnectorMock.AddAccount(TempEmailAccount); // [When] The email is Sent - Assert.IsTrue(Email.Send(EmailMessage, EmailAccount), 'Sending an email should have succeeded'); + Assert.IsTrue(Email.Send(EmailMessage, TempEmailAccount), 'Sending an email should have succeeded'); // [Then] There is a Sent Mail record and no Outbox record - SentEmail.SetRange("Account Id", EmailAccount."Account Id"); + SentEmail.SetRange("Account Id", TempEmailAccount."Account Id"); SentEmail.SetRange("Message Id", EmailMessage.GetId()); Assert.IsTrue(SentEmail.FindFirst(), 'The email sent record should exist'); Assert.AreEqual(EmailMessage.GetId(), SentEmail."Message Id", 'Wrong email message'); - Assert.AreEqual(EmailAccount."Email Address", SentEmail."Sent From", 'Wrong email address (sent from)'); + Assert.AreEqual(TempEmailAccount."Email Address", SentEmail."Sent From", 'Wrong email address (sent from)'); Assert.AreNotEqual(0DT, SentEmail."Date Time Sent", 'The Date Time Sent should be filled'); - Assert.AreEqual(EmailAccount."Account Id", SentEmail."Account Id", 'Wrong account'); + Assert.AreEqual(TempEmailAccount."Account Id", SentEmail."Account Id", 'Wrong account'); Assert.AreEqual(Connector::"Test Email Connector".AsInteger(), SentEmail.Connector.AsInteger(), 'Wrong connector'); Assert.AreEqual(EmailMessage.GetSubject(), SentEmail.Description, 'Wrong description'); // There is no related outbox - EmailOutbox.SetRange("Account Id", EmailAccount."Account Id"); + EmailOutbox.SetRange("Account Id", TempEmailAccount."Account Id"); EmailOutbox.SetRange("Message Id", EmailMessage.GetId()); Assert.AreEqual(0, EmailOutbox.Count(), 'Email Outbox was not empty.'); @@ -911,7 +911,7 @@ codeunit 134685 "Email Test" procedure SendEmailMessageWithSourceTest() var TempSentEmail: Record "Sent Email" temporary; - EmailAccount: Record "Email Account"; + TempEmailAccount: Record "Email Account"; EmailMessage: Codeunit "Email Message"; ConnectorMock: Codeunit "Connector Mock"; Any: Codeunit Any; @@ -927,7 +927,7 @@ codeunit 134685 "Email Test" SystemId := Any.GuidValue(); ConnectorMock.Initialize(); - ConnectorMock.AddAccount(EmailAccount); + ConnectorMock.AddAccount(TempEmailAccount); NumberOfEmails := Any.IntegerInRange(2, 5); @@ -937,7 +937,7 @@ codeunit 134685 "Email Test" MessageIds.Add(EmailMessage.GetId()); // [When] The email is Sent - Assert.IsTrue(Email.Send(EmailMessage, EmailAccount), 'Sending an email should have succeeded'); + Assert.IsTrue(Email.Send(EmailMessage, TempEmailAccount), 'Sending an email should have succeeded'); end; Email.GetSentEmailsForRecord(TableId, SystemId, TempSentEmail); @@ -999,7 +999,7 @@ codeunit 134685 "Email Test" [Scope('OnPrem')] procedure GetRelatedAttachmentsTest() var - EmailRelatedAttachment: Record "Email Related Attachment"; + TempEmailRelatedAttachment: Record "Email Related Attachment"; EmailOutbox: Record "Email Outbox"; EmailMessage: Codeunit "Email Message"; EmailTest: Codeunit "Email Test"; @@ -1024,10 +1024,10 @@ codeunit 134685 "Email Test" SourceText := StrSubstNo(OutboxSourceTextLbl, EmailOutbox.TableCaption(), Format(EmailOutbox.Id)); VariableStorage.Enqueue(SourceText); - EmailEditor.GetRelatedAttachments(EmailMessage.GetId(), EmailRelatedAttachment); + EmailEditor.GetRelatedAttachments(EmailMessage.GetId(), TempEmailRelatedAttachment); - Assert.AreEqual(1, EmailRelatedAttachment.Count(), 'Wrong number of attachments.'); - Assert.AreEqual('Attachment1', EmailRelatedAttachment."Attachment Name", 'Wrong attachment name'); + Assert.AreEqual(1, TempEmailRelatedAttachment.Count(), 'Wrong number of attachments.'); + Assert.AreEqual('Attachment1', TempEmailRelatedAttachment."Attachment Name", 'Wrong attachment name'); end; [Test] @@ -1057,7 +1057,7 @@ codeunit 134685 "Email Test" [Scope('OnPrem')] procedure SendEmailInBackgroundSuccessTest() var - EmailAccount: Record "Email Account"; + TempEmailAccount: Record "Email Account"; EmailMessage: Codeunit "Email Message"; ConnectorMock: Codeunit "Connector Mock"; TestClientType: Codeunit "Test Client Type Subscriber"; @@ -1078,10 +1078,10 @@ codeunit 134685 "Email Test" Assert.IsTrue(EmailMessage.Get(EmailMessage.GetId()), 'The email should exist'); ConnectorMock.Initialize(); - ConnectorMock.AddAccount(EmailAccount); + ConnectorMock.AddAccount(TempEmailAccount); // [When] The email is Sent - Email.Send(EmailMessage, EmailAccount); + Email.Send(EmailMessage, TempEmailAccount); // [Then] An event is fired to notify for the status of the email EmailTest.DequeueVariable(Variable); @@ -1102,7 +1102,7 @@ codeunit 134685 "Email Test" [Scope('OnPrem')] procedure SendEmailInBackgroundFailTest() var - EmailAccount: Record "Email Account"; + TempEmailAccount: Record "Email Account"; EmailMessage: Codeunit "Email Message"; ConnectorMock: Codeunit "Connector Mock"; TestClientType: Codeunit "Test Client Type Subscriber"; @@ -1123,11 +1123,11 @@ codeunit 134685 "Email Test" Assert.IsTrue(EmailMessage.Get(EmailMessage.GetId()), 'The email should exist'); ConnectorMock.Initialize(); - ConnectorMock.AddAccount(EmailAccount); + ConnectorMock.AddAccount(TempEmailAccount); ConnectorMock.FailOnSend(true); // [When] The email is Sent - Email.Send(EmailMessage, EmailAccount); + Email.Send(EmailMessage, TempEmailAccount); // [Then] An event is fired to notify for the status of the email EmailTest.DequeueVariable(Variable); @@ -1148,7 +1148,7 @@ codeunit 134685 "Email Test" [Scope('OnPrem')] procedure SendEmailInBackgroundFailSubscriberFailsTest() var - EmailAccount: Record "Email Account"; + TempEmailAccount: Record "Email Account"; EmailMessage: Codeunit "Email Message"; ConnectorMock: Codeunit "Connector Mock"; TestClientType: Codeunit "Test Client Type Subscriber"; @@ -1171,11 +1171,11 @@ codeunit 134685 "Email Test" Assert.IsTrue(EmailMessage.Get(EmailMessage.GetId()), 'The email should exist'); ConnectorMock.Initialize(); - ConnectorMock.AddAccount(EmailAccount); + ConnectorMock.AddAccount(TempEmailAccount); ConnectorMock.FailOnSend(true); // [When] The email is Sent - Email.Send(EmailMessage, EmailAccount); + Email.Send(EmailMessage, TempEmailAccount); // [Then] An event is fired to notify for the status of the email EmailTest.DequeueVariable(Variable); @@ -1197,7 +1197,7 @@ codeunit 134685 "Email Test" [Scope('OnPrem')] procedure SendEmailInBackgroundSuccessSubscriberFailsTest() var - EmailAccount: Record "Email Account"; + TempEmailAccount: Record "Email Account"; EmailOutbox: Record "Email Outbox"; EmailMessage: Codeunit "Email Message"; ConnectorMock: Codeunit "Connector Mock"; @@ -1221,10 +1221,10 @@ codeunit 134685 "Email Test" Assert.IsTrue(EmailMessage.Get(EmailMessage.GetId()), 'The email should exist'); ConnectorMock.Initialize(); - ConnectorMock.AddAccount(EmailAccount); + ConnectorMock.AddAccount(TempEmailAccount); // [When] The email is Sent - Email.Send(EmailMessage, EmailAccount); + Email.Send(EmailMessage, TempEmailAccount); // [Then] An event is fired to notify for the status of the email EmailTest.DequeueVariable(Variable); @@ -1348,7 +1348,7 @@ codeunit 134685 "Email Test" var SentEmail: Record "Sent Email"; TempSentEmail: Record "Sent Email" temporary; - EmailAccount: Record "Email Account"; + TempEmailAccount: Record "Email Account"; EmailMessage: Codeunit "Email Message"; ConnectorMock: Codeunit "Connector Mock"; Any: Codeunit Any; @@ -1362,9 +1362,9 @@ codeunit 134685 "Email Test" // [Given] An email with source and an email account ConnectorMock.Initialize(); - ConnectorMock.AddAccount(EmailAccount); + ConnectorMock.AddAccount(TempEmailAccount); TableId := Database::"Email Account"; - SystemId := EmailAccount.SystemId; + SystemId := TempEmailAccount.SystemId; NumberOfEmails := Any.IntegerInRange(2, 5); for i := 1 to NumberOfEmails do begin @@ -1373,11 +1373,11 @@ codeunit 134685 "Email Test" MessageIds.Add(EmailMessage.GetId()); // [When] The email is Sent - Assert.IsTrue(Email.Send(EmailMessage, EmailAccount), 'Sending an email should have succeeded'); + Assert.IsTrue(Email.Send(EmailMessage, TempEmailAccount), 'Sending an email should have succeeded'); end; // [Then] GetSentEmailsForRecord procedure return related Sent Email records - Email.GetSentEmailsForRecord(EmailAccount, TempSentEmail); + Email.GetSentEmailsForRecord(TempEmailAccount, TempSentEmail); Assert.AreEqual(NumberOfEmails, TempSentEmail.Count(), 'Sent Emails count is not equal to Number of Emails sent.'); for i := 1 to NumberOfEmails do begin @@ -1390,7 +1390,7 @@ codeunit 134685 "Email Test" [Test] procedure RetrieveEmailsWithV1Connector() var - EmailAccount: Record "Email Account"; + TempEmailAccount: Record "Email Account"; EmailInbox: Record "Email Inbox"; TempFilters: Record "Email Retrieval Filters" temporary; ConnectorMock: Codeunit "Connector Mock"; @@ -1398,11 +1398,11 @@ codeunit 134685 "Email Test" // [Scenario] Retrieving emails with a V1 connector should fail // [Given] An email account with a V1 connector ConnectorMock.Initialize(); - ConnectorMock.AddAccount(EmailAccount); + ConnectorMock.AddAccount(TempEmailAccount); // [When] Retrieving emails // [Then] An error is thrown that the connector does not support this operation - asserterror Email.RetrieveEmails(EmailAccount."Account Id", EmailAccount.Connector, EmailInbox, TempFilters); + asserterror Email.RetrieveEmails(TempEmailAccount."Account Id", TempEmailAccount.Connector, EmailInbox, TempFilters); Assert.ExpectedError('The selected email connector does not support retrieving emails'); end; @@ -1411,7 +1411,7 @@ codeunit 134685 "Email Test" [Obsolete('v2 connector is replaced by v3 connector.', '26.0')] procedure RetrieveEmailsv2() var - EmailAccount: Record "Email Account"; + TempEmailAccount: Record "Email Account"; EmailInbox: Record "Email Inbox"; ConnectorMock: Codeunit "Connector Mock"; InitialId: Integer; @@ -1422,16 +1422,16 @@ codeunit 134685 "Email Test" // [Given] An email account with a V1 connector // [Given] Existing emails in Email Inbox ConnectorMock.Initialize(); - ConnectorMock.AddAccount(EmailAccount, Enum::"Email Connector"::"Test Email Connector v2"); + ConnectorMock.AddAccount(TempEmailAccount, Enum::"Email Connector"::"Test Email Connector v2"); EmailInbox.DeleteAll(); - ConnectorMock.CreateEmailInbox(EmailAccount."Account Id", EmailAccount.Connector, EmailInbox); + ConnectorMock.CreateEmailInbox(TempEmailAccount."Account Id", TempEmailAccount.Connector, EmailInbox); Assert.AreEqual(1, EmailInbox.Count(), 'Wrong number of emails in the inbox'); InitialId := EmailInbox.Id; // [When] Retrieving emails #pragma warning disable AL0432 - Email.RetrieveEmails(EmailAccount."Account Id", EmailAccount.Connector, EmailInbox); + Email.RetrieveEmails(TempEmailAccount."Account Id", TempEmailAccount.Connector, EmailInbox); #pragma warning restore AL0432 // [Then] The EmailInbox will be filled only with new emails and not existing ones @@ -1447,7 +1447,7 @@ codeunit 134685 "Email Test" [Obsolete('v2 connector is replaced by v3 connector.', '26.0')] procedure RetrieveEmailsFailv2() var - EmailAccount: Record "Email Account"; + TempEmailAccount: Record "Email Account"; EmailInbox: Record "Email Inbox"; ConnectorMock: Codeunit "Connector Mock"; begin @@ -1457,10 +1457,10 @@ codeunit 134685 "Email Test" // [Given] An email account with a V1 connector // [Given] Existing emails in Email Inbox ConnectorMock.Initialize(); - ConnectorMock.AddAccount(EmailAccount, Enum::"Email Connector"::"Test Email Connector v2"); + ConnectorMock.AddAccount(TempEmailAccount, Enum::"Email Connector"::"Test Email Connector v2"); EmailInbox.DeleteAll(); - ConnectorMock.CreateEmailInbox(EmailAccount."Account Id", EmailAccount.Connector, EmailInbox); + ConnectorMock.CreateEmailInbox(TempEmailAccount."Account Id", TempEmailAccount.Connector, EmailInbox); Assert.AreEqual(1, EmailInbox.Count(), 'Wrong number of emails in the inbox'); // [Given] An error occurs when retrieving emails @@ -1468,7 +1468,7 @@ codeunit 134685 "Email Test" // [When] Retrieving emails #pragma warning disable AL0432 - asserterror Email.RetrieveEmails(EmailAccount."Account Id", EmailAccount.Connector, EmailInbox); + asserterror Email.RetrieveEmails(TempEmailAccount."Account Id", TempEmailAccount.Connector, EmailInbox); #pragma warning restore AL0432 // [Then] The EmailInbox will be filled only with new emails and not existing ones @@ -1478,7 +1478,7 @@ codeunit 134685 "Email Test" [Test] procedure RetrieveEmailsv4() var - EmailAccount: Record "Email Account"; + TempEmailAccount: Record "Email Account"; EmailInbox: Record "Email Inbox"; TempFilters: Record "Email Retrieval Filters" temporary; ConnectorMock: Codeunit "Connector Mock"; @@ -1490,15 +1490,15 @@ codeunit 134685 "Email Test" // [Given] An email account with a V4 connector // [Given] Existing emails in Email Inbox ConnectorMock.Initialize(); - ConnectorMock.AddAccount(EmailAccount, Enum::"Email Connector"::"Test Email Connector v4"); + ConnectorMock.AddAccount(TempEmailAccount, Enum::"Email Connector"::"Test Email Connector v4"); EmailInbox.DeleteAll(); - ConnectorMock.CreateEmailInbox(EmailAccount."Account Id", EmailAccount.Connector, EmailInbox); + ConnectorMock.CreateEmailInbox(TempEmailAccount."Account Id", TempEmailAccount.Connector, EmailInbox); Assert.AreEqual(1, EmailInbox.Count(), 'Wrong number of emails in the inbox'); InitialId := EmailInbox.Id; // [When] Retrieving emails - Email.RetrieveEmails(EmailAccount."Account Id", EmailAccount.Connector, EmailInbox, TempFilters); + Email.RetrieveEmails(TempEmailAccount."Account Id", TempEmailAccount.Connector, EmailInbox, TempFilters); // [Then] The EmailInbox will be filled only with new emails and not existing ones EmailInbox.FindSet(); @@ -1512,7 +1512,7 @@ codeunit 134685 "Email Test" [Test] procedure RetrieveEmailsFailv4() var - EmailAccount: Record "Email Account"; + TempEmailAccount: Record "Email Account"; EmailInbox: Record "Email Inbox"; TempFilters: Record "Email Retrieval Filters" temporary; ConnectorMock: Codeunit "Connector Mock"; @@ -1523,17 +1523,17 @@ codeunit 134685 "Email Test" // [Given] An email account with a V4 connector // [Given] Existing emails in Email Inbox ConnectorMock.Initialize(); - ConnectorMock.AddAccount(EmailAccount, Enum::"Email Connector"::"Test Email Connector v4"); + ConnectorMock.AddAccount(TempEmailAccount, Enum::"Email Connector"::"Test Email Connector v4"); EmailInbox.DeleteAll(); - ConnectorMock.CreateEmailInbox(EmailAccount."Account Id", EmailAccount.Connector, EmailInbox); + ConnectorMock.CreateEmailInbox(TempEmailAccount."Account Id", TempEmailAccount.Connector, EmailInbox); Assert.AreEqual(1, EmailInbox.Count(), 'Wrong number of emails in the inbox'); // [Given] An error occurs when retrieving emails ConnectorMock.FailOnRetrieveEmails(true); // [When] Retrieving emails - asserterror Email.RetrieveEmails(EmailAccount."Account Id", EmailAccount.Connector, EmailInbox, TempFilters); + asserterror Email.RetrieveEmails(TempEmailAccount."Account Id", TempEmailAccount.Connector, EmailInbox, TempFilters); // [Then] The EmailInbox will be filled only with new emails and not existing ones Assert.ExpectedError('Failed to retrieve emails'); @@ -1542,18 +1542,18 @@ codeunit 134685 "Email Test" [Test] procedure MarkEmailAsReadWithV1Connector() var - EmailAccount: Record "Email Account"; + TempEmailAccount: Record "Email Account"; ConnectorMock: Codeunit "Connector Mock"; Any: Codeunit Any; begin // [Scenario] Marking email as read with a V1 connector should fail // [Given] An email account with a V1 connector ConnectorMock.Initialize(); - ConnectorMock.AddAccount(EmailAccount); + ConnectorMock.AddAccount(TempEmailAccount); // [When] Mark email as read // [Then] An error is thrown that the connector does not support this operation - asserterror Email.MarkAsRead(EmailAccount."Account Id", EmailAccount.Connector, Any.AlphabeticText(10)); + asserterror Email.MarkAsRead(TempEmailAccount."Account Id", TempEmailAccount.Connector, Any.AlphabeticText(10)); Assert.ExpectedError('The selected email connector does not support marking emails as read'); end; #if not CLEAN26 @@ -1561,39 +1561,39 @@ codeunit 134685 "Email Test" [Obsolete('v2 connector is replaced by v3 connector.', '26.0')] procedure MarkEmailAsRead() var - EmailAccount: Record "Email Account"; + TempEmailAccount: Record "Email Account"; ConnectorMock: Codeunit "Connector Mock"; Any: Codeunit Any; begin // [Scenario] Marking email as read with a V2 connector should succeed with no errors // [Given] An email account with a V2 connector ConnectorMock.Initialize(); - ConnectorMock.AddAccount(EmailAccount, Enum::"Email Connector"::"Test Email Connector v2"); + ConnectorMock.AddAccount(TempEmailAccount, Enum::"Email Connector"::"Test Email Connector v2"); // [When] Mark email as read // [Then] No error occurs - Email.MarkAsRead(EmailAccount."Account Id", EmailAccount.Connector, Any.AlphabeticText(10)); + Email.MarkAsRead(TempEmailAccount."Account Id", TempEmailAccount.Connector, Any.AlphabeticText(10)); end; [Test] [Obsolete('v2 connector is replaced by v3 connector.', '26.0')] procedure MarkEmailAsReadFail() var - EmailAccount: Record "Email Account"; + TempEmailAccount: Record "Email Account"; ConnectorMock: Codeunit "Connector Mock"; Any: Codeunit Any; begin // [Scenario] Marking email as read with a V2 connector fails due to some error // [Given] An email account with a V2 connector ConnectorMock.Initialize(); - ConnectorMock.AddAccount(EmailAccount, Enum::"Email Connector"::"Test Email Connector v2"); + ConnectorMock.AddAccount(TempEmailAccount, Enum::"Email Connector"::"Test Email Connector v2"); // [Given] Force an error to occur when marking email as read ConnectorMock.FailOnMarkAsRead(true); // [When] Mark email as read // [Then] An error occurs - asserterror Email.MarkAsRead(EmailAccount."Account Id", EmailAccount.Connector, Any.AlphabeticText(10)); + asserterror Email.MarkAsRead(TempEmailAccount."Account Id", TempEmailAccount.Connector, Any.AlphabeticText(10)); Assert.ExpectedError('Failed to mark email as read'); end; #endif @@ -1601,57 +1601,57 @@ codeunit 134685 "Email Test" [Test] procedure MarkEmailAsReadv4() var - EmailAccount: Record "Email Account"; + TempEmailAccount: Record "Email Account"; ConnectorMock: Codeunit "Connector Mock"; Any: Codeunit Any; begin // [Scenario] Marking email as read with a V4 connector should succeed with no errors // [Given] An email account with a V4 connector ConnectorMock.Initialize(); - ConnectorMock.AddAccount(EmailAccount, Enum::"Email Connector"::"Test Email Connector v4"); + ConnectorMock.AddAccount(TempEmailAccount, Enum::"Email Connector"::"Test Email Connector v4"); // [When] Mark email as read // [Then] No error occurs - Email.MarkAsRead(EmailAccount."Account Id", EmailAccount.Connector, Any.AlphabeticText(10)); + Email.MarkAsRead(TempEmailAccount."Account Id", TempEmailAccount.Connector, Any.AlphabeticText(10)); end; [Test] procedure MarkEmailAsReadFailv4() var - EmailAccount: Record "Email Account"; + TempEmailAccount: Record "Email Account"; ConnectorMock: Codeunit "Connector Mock"; Any: Codeunit Any; begin // [Scenario] Marking email as read with a V4 connector fails due to some error // [Given] An email account with a V4 connector ConnectorMock.Initialize(); - ConnectorMock.AddAccount(EmailAccount, Enum::"Email Connector"::"Test Email Connector v4"); + ConnectorMock.AddAccount(TempEmailAccount, Enum::"Email Connector"::"Test Email Connector v4"); // [Given] Force an error to occur when marking email as read ConnectorMock.FailOnMarkAsRead(true); // [When] Mark email as read // [Then] An error occurs - asserterror Email.MarkAsRead(EmailAccount."Account Id", EmailAccount.Connector, Any.AlphabeticText(10)); + asserterror Email.MarkAsRead(TempEmailAccount."Account Id", TempEmailAccount.Connector, Any.AlphabeticText(10)); Assert.ExpectedError('Failed to mark email as read'); end; [Test] procedure ReplyToEmailWithV1Connector() var - EmailAccount: Record "Email Account"; + TempEmailAccount: Record "Email Account"; EmailMessage: Codeunit "Email Message"; ConnectorMock: Codeunit "Connector Mock"; begin // [Scenario] Replying to an email with a V1 connector should fail // [Given] An email account with a V1 connector ConnectorMock.Initialize(); - ConnectorMock.AddAccount(EmailAccount); + ConnectorMock.AddAccount(TempEmailAccount); CreateEmailReply(EmailMessage); // [When] Reply to email // [Then] An error is thrown that the connector does not support this operation - asserterror Email.Reply(EmailMessage, EmailAccount."Account Id", EmailAccount.Connector); + asserterror Email.Reply(EmailMessage, TempEmailAccount."Account Id", TempEmailAccount.Connector); Assert.ExpectedError('The selected email connector does not support replying to emails'); end; @@ -1660,7 +1660,7 @@ codeunit 134685 "Email Test" [Obsolete('v2 connector is replaced by v3 connector.', '26.0')] procedure ReplyToEmail() var - EmailAccount: Record "Email Account"; + TempEmailAccount: Record "Email Account"; EmailMessage: Codeunit "Email Message"; ConnectorMock: Codeunit "Connector Mock"; Any: Codeunit Any; @@ -1668,19 +1668,19 @@ codeunit 134685 "Email Test" // [Scenario] Replying to an email with a V2 connector should succeed with no errors // [Given] An email account with a V2 connector ConnectorMock.Initialize(); - ConnectorMock.AddAccount(EmailAccount, Enum::"Email Connector"::"Test Email Connector v2"); + ConnectorMock.AddAccount(TempEmailAccount, Enum::"Email Connector"::"Test Email Connector v2"); CreateEmailReply(EmailMessage); // [When] Reply to email // [Then] No error occurs and reply returns true - Assert.IsTrue(Email.Reply(EmailMessage, EmailAccount."Account Id", EmailAccount.Connector), 'Did not succeed in replying the email'); + Assert.IsTrue(Email.Reply(EmailMessage, TempEmailAccount."Account Id", TempEmailAccount.Connector), 'Did not succeed in replying the email'); end; [Test] [Obsolete('v2 connector is replaced by v3 connector.', '26.0')] procedure ReplyToEmailWithNoRecipients() var - EmailAccount: Record "Email Account"; + TempEmailAccount: Record "Email Account"; EmailMessage: Codeunit "Email Message"; ConnectorMock: Codeunit "Connector Mock"; Any: Codeunit Any; @@ -1688,68 +1688,68 @@ codeunit 134685 "Email Test" // [Scenario] Replying to an email with a V2 connector should succeed with no errors // [Given] An email account with a V2 connector ConnectorMock.Initialize(); - ConnectorMock.AddAccount(EmailAccount, Enum::"Email Connector"::"Test Email Connector v2"); + ConnectorMock.AddAccount(TempEmailAccount, Enum::"Email Connector"::"Test Email Connector v2"); CreateEmailReply(EmailMessage, ''); // [When] Reply to email // [Then] No error occurs and reply returns true - asserterror Email.Reply(EmailMessage, EmailAccount."Account Id", EmailAccount.Connector); + asserterror Email.Reply(EmailMessage, TempEmailAccount."Account Id", TempEmailAccount.Connector); Assert.ExpectedError('You must specify a valid email account to send the message to'); end; #endif [Test] procedure ReplyToEmailv4() var - EmailAccount: Record "Email Account"; + TempEmailAccount: Record "Email Account"; EmailMessage: Codeunit "Email Message"; ConnectorMock: Codeunit "Connector Mock"; begin // [Scenario] Replying to an email with a V4 connector should succeed with no errors // [Given] An email account with a V4 connector ConnectorMock.Initialize(); - ConnectorMock.AddAccount(EmailAccount, Enum::"Email Connector"::"Test Email Connector v4"); + ConnectorMock.AddAccount(TempEmailAccount, Enum::"Email Connector"::"Test Email Connector v4"); CreateEmailReply(EmailMessage); // [When] Reply to email // [Then] No error occurs and reply returns true - Assert.IsTrue(Email.Reply(EmailMessage, EmailAccount."Account Id", EmailAccount.Connector), 'Did not succeed in replying the email'); + Assert.IsTrue(Email.Reply(EmailMessage, TempEmailAccount."Account Id", TempEmailAccount.Connector), 'Did not succeed in replying the email'); end; [Test] procedure ReplyToEmailWithNoRecipientsv4() var - EmailAccount: Record "Email Account"; + TempEmailAccount: Record "Email Account"; EmailMessage: Codeunit "Email Message"; ConnectorMock: Codeunit "Connector Mock"; begin // [Scenario] Replying to an email with a V4 connector should succeed with no errors // [Given] An email account with a V4 connector ConnectorMock.Initialize(); - ConnectorMock.AddAccount(EmailAccount, Enum::"Email Connector"::"Test Email Connector v4"); + ConnectorMock.AddAccount(TempEmailAccount, Enum::"Email Connector"::"Test Email Connector v4"); CreateEmailReply(EmailMessage, ''); // [When] Reply to email // [Then] No error occurs and reply returns true - asserterror Email.Reply(EmailMessage, EmailAccount."Account Id", EmailAccount.Connector); + asserterror Email.Reply(EmailMessage, TempEmailAccount."Account Id", TempEmailAccount.Connector); Assert.ExpectedError('You must specify a valid email account to send the message to'); end; [Test] procedure ReplyAllToEmailWithV1Connector() var - EmailAccount: Record "Email Account"; + TempEmailAccount: Record "Email Account"; EmailMessage: Codeunit "Email Message"; ConnectorMock: Codeunit "Connector Mock"; begin // [Scenario] Replying to an email with a V1 connector should fail // [Given] An email account with a V1 connector ConnectorMock.Initialize(); - ConnectorMock.AddAccount(EmailAccount); + ConnectorMock.AddAccount(TempEmailAccount); CreateEmailReplyAll(EmailMessage); // [When] Reply to email // [Then] An error is thrown that the connector does not support this operation - asserterror Email.ReplyAll(EmailMessage, EmailAccount."Account Id", EmailAccount.Connector); + asserterror Email.ReplyAll(EmailMessage, TempEmailAccount."Account Id", TempEmailAccount.Connector); Assert.ExpectedError('The selected email connector does not support replying to emails'); end; @@ -1758,7 +1758,7 @@ codeunit 134685 "Email Test" [Obsolete('v2 connector is replaced by v3 connector.', '26.0')] procedure ReplyAllToEmail() var - EmailAccount: Record "Email Account"; + TempEmailAccount: Record "Email Account"; EmailMessage: Codeunit "Email Message"; ConnectorMock: Codeunit "Connector Mock"; Any: Codeunit Any; @@ -1766,19 +1766,19 @@ codeunit 134685 "Email Test" // [Scenario] Replying to an email with a V2 connector should succeed with no errors // [Given] An email account with a V2 connector ConnectorMock.Initialize(); - ConnectorMock.AddAccount(EmailAccount, Enum::"Email Connector"::"Test Email Connector v2"); + ConnectorMock.AddAccount(TempEmailAccount, Enum::"Email Connector"::"Test Email Connector v2"); CreateEmailReplyAll(EmailMessage); // [When] Reply to email // [Then] No error occurs and reply returns true - Assert.IsTrue(Email.ReplyAll(EmailMessage, EmailAccount."Account Id", EmailAccount.Connector), 'Did not succeed in replying the email'); + Assert.IsTrue(Email.ReplyAll(EmailMessage, TempEmailAccount."Account Id", TempEmailAccount.Connector), 'Did not succeed in replying the email'); end; [Test] [Obsolete('v2 connector is replaced by v3 connector.', '26.0')] procedure ReplyAllToEmailFail() var - EmailAccount: Record "Email Account"; + TempEmailAccount: Record "Email Account"; EmailMessage: Codeunit "Email Message"; ConnectorMock: Codeunit "Connector Mock"; Any: Codeunit Any; @@ -1786,7 +1786,7 @@ codeunit 134685 "Email Test" // [Scenario] Replying to an email with a V2 connector fails due to some error // [Given] An email account with a V2 connector ConnectorMock.Initialize(); - ConnectorMock.AddAccount(EmailAccount, Enum::"Email Connector"::"Test Email Connector v2"); + ConnectorMock.AddAccount(TempEmailAccount, Enum::"Email Connector"::"Test Email Connector v2"); CreateEmailReplyAll(EmailMessage); // [Given] Force the connector to fail on reply @@ -1794,39 +1794,39 @@ codeunit 134685 "Email Test" // [When] Reply to email // [Then] No error occurs and reply returns true - Assert.IsFalse(Email.ReplyAll(EmailMessage, EmailAccount."Account Id", EmailAccount.Connector), 'Did succeed in replying the email when it should fail'); + Assert.IsFalse(Email.ReplyAll(EmailMessage, TempEmailAccount."Account Id", TempEmailAccount.Connector), 'Did succeed in replying the email when it should fail'); end; #endif [Test] procedure ReplyAllToEmailv4() var - EmailAccount: Record "Email Account"; + TempEmailAccount: Record "Email Account"; EmailMessage: Codeunit "Email Message"; ConnectorMock: Codeunit "Connector Mock"; begin // [Scenario] Replying to an email with a V4 connector should succeed with no errors // [Given] An email account with a V4 connector ConnectorMock.Initialize(); - ConnectorMock.AddAccount(EmailAccount, Enum::"Email Connector"::"Test Email Connector v4"); + ConnectorMock.AddAccount(TempEmailAccount, Enum::"Email Connector"::"Test Email Connector v4"); CreateEmailReplyAll(EmailMessage); // [When] Reply to email // [Then] No error occurs and reply returns true - Assert.IsTrue(Email.ReplyAll(EmailMessage, EmailAccount."Account Id", EmailAccount.Connector), 'Did not succeed in replying the email'); + Assert.IsTrue(Email.ReplyAll(EmailMessage, TempEmailAccount."Account Id", TempEmailAccount.Connector), 'Did not succeed in replying the email'); end; [Test] procedure ReplyAllToEmailFailv4() var - EmailAccount: Record "Email Account"; + TempEmailAccount: Record "Email Account"; EmailMessage: Codeunit "Email Message"; ConnectorMock: Codeunit "Connector Mock"; begin // [Scenario] Replying to an email with a V4 connector fails due to some error // [Given] An email account with a V4 connector ConnectorMock.Initialize(); - ConnectorMock.AddAccount(EmailAccount, Enum::"Email Connector"::"Test Email Connector v4"); + ConnectorMock.AddAccount(TempEmailAccount, Enum::"Email Connector"::"Test Email Connector v4"); CreateEmailReplyAll(EmailMessage); // [Given] Force the connector to fail on reply @@ -1834,13 +1834,13 @@ codeunit 134685 "Email Test" // [When] Reply to email // [Then] No error occurs and reply returns true - Assert.IsFalse(Email.ReplyAll(EmailMessage, EmailAccount."Account Id", EmailAccount.Connector), 'Did succeed in replying the email when it should fail'); + Assert.IsFalse(Email.ReplyAll(EmailMessage, TempEmailAccount."Account Id", TempEmailAccount.Connector), 'Did succeed in replying the email when it should fail'); end; [Test] procedure EnqueueReplyToEmailWithV1Connector() var - EmailAccount: Record "Email Account"; + TempEmailAccount: Record "Email Account"; EmailOutbox: Record "Email Outbox"; EmailMessage: Codeunit "Email Message"; ConnectorMock: Codeunit "Connector Mock"; @@ -1848,12 +1848,12 @@ codeunit 134685 "Email Test" // [Scenario] Replying to an email with a V1 connector should fail // [Given] An email account with a V1 connector ConnectorMock.Initialize(); - ConnectorMock.AddAccount(EmailAccount); + ConnectorMock.AddAccount(TempEmailAccount); CreateEmailReply(EmailMessage); // [When] Reply to email // [Then] An error is thrown that the connector does not support this operation - asserterror Email.EnqueueReply(EmailMessage, EmailAccount."Account Id", EmailAccount.Connector, EmailOutbox); + asserterror Email.EnqueueReply(EmailMessage, TempEmailAccount."Account Id", TempEmailAccount.Connector, EmailOutbox); Assert.ExpectedError('The selected email connector does not support replying to emails'); end; #if not CLEAN26 @@ -1861,7 +1861,7 @@ codeunit 134685 "Email Test" [Obsolete('v2 connector is replaced by v3 connector.', '26.0')] procedure EnqueueReplyToEmail() var - EmailAccount: Record "Email Account"; + TempEmailAccount: Record "Email Account"; EmailOutbox: Record "Email Outbox"; EmailMessage: Codeunit "Email Message"; ConnectorMock: Codeunit "Connector Mock"; @@ -1870,13 +1870,13 @@ codeunit 134685 "Email Test" // [Scenario] Replying to an email with a V2 connector should succeed with no errors // [Given] An email account with a V2 connector ConnectorMock.Initialize(); - ConnectorMock.AddAccount(EmailAccount, Enum::"Email Connector"::"Test Email Connector v2"); + ConnectorMock.AddAccount(TempEmailAccount, Enum::"Email Connector"::"Test Email Connector v2"); CreateEmailReply(EmailMessage); // [When] Reply to email // [Then] No error occurs and reply returns true Assert.IsTrue(IsNullGuid(EmailOutbox."Message Id"), 'The email message id in the outbox should be empty'); - Email.EnqueueReply(EmailMessage, EmailAccount."Account Id", EmailAccount.Connector, EmailOutbox); + Email.EnqueueReply(EmailMessage, TempEmailAccount."Account Id", TempEmailAccount.Connector, EmailOutbox); Assert.AreEqual(EmailMessage.GetId(), EmailOutbox."Message Id", 'The email message id should be the same as the one in the outbox'); end; @@ -1885,7 +1885,7 @@ codeunit 134685 "Email Test" [Obsolete('v2 connector is replaced by v3 connector.', '26.0')] procedure EnqueueReplyToEmailWithNoRecipients() var - EmailAccount: Record "Email Account"; + TempEmailAccount: Record "Email Account"; EmailOutbox: Record "Email Outbox"; EmailMessage: Codeunit "Email Message"; ConnectorMock: Codeunit "Connector Mock"; @@ -1894,12 +1894,12 @@ codeunit 134685 "Email Test" // [Scenario] Replying to an email with a V2 connector should succeed with no errors // [Given] An email account with a V2 connector ConnectorMock.Initialize(); - ConnectorMock.AddAccount(EmailAccount, Enum::"Email Connector"::"Test Email Connector v2"); + ConnectorMock.AddAccount(TempEmailAccount, Enum::"Email Connector"::"Test Email Connector v2"); CreateEmailReply(EmailMessage, ''); // [When] Reply to email // [Then] No error occurs and reply returns true - asserterror Email.EnqueueReply(EmailMessage, EmailAccount."Account Id", EmailAccount.Connector, EmailOutbox); + asserterror Email.EnqueueReply(EmailMessage, TempEmailAccount."Account Id", TempEmailAccount.Connector, EmailOutbox); Assert.ExpectedError('You must specify a valid email account to send the message to'); end; #endif @@ -1907,7 +1907,7 @@ codeunit 134685 "Email Test" [Test] procedure EnqueueReplyToEmailv4() var - EmailAccount: Record "Email Account"; + TempEmailAccount: Record "Email Account"; EmailOutbox: Record "Email Outbox"; EmailMessage: Codeunit "Email Message"; ConnectorMock: Codeunit "Connector Mock"; @@ -1915,13 +1915,13 @@ codeunit 134685 "Email Test" // [Scenario] Replying to an email with a V4 connector should succeed with no errors // [Given] An email account with a V4 connector ConnectorMock.Initialize(); - ConnectorMock.AddAccount(EmailAccount, Enum::"Email Connector"::"Test Email Connector v4"); + ConnectorMock.AddAccount(TempEmailAccount, Enum::"Email Connector"::"Test Email Connector v4"); CreateEmailReply(EmailMessage); // [When] Reply to email // [Then] No error occurs and reply returns true Assert.IsTrue(IsNullGuid(EmailOutbox."Message Id"), 'The email message id in the outbox should be empty'); - Email.EnqueueReply(EmailMessage, EmailAccount."Account Id", EmailAccount.Connector, EmailOutbox); + Email.EnqueueReply(EmailMessage, TempEmailAccount."Account Id", TempEmailAccount.Connector, EmailOutbox); Assert.AreEqual(EmailMessage.GetId(), EmailOutbox."Message Id", 'The email message id should be the same as the one in the outbox'); end; @@ -1929,7 +1929,7 @@ codeunit 134685 "Email Test" [Test] procedure EnqueueReplyToEmailWithNoRecipientsv4() var - EmailAccount: Record "Email Account"; + TempEmailAccount: Record "Email Account"; EmailOutbox: Record "Email Outbox"; EmailMessage: Codeunit "Email Message"; ConnectorMock: Codeunit "Connector Mock"; @@ -1937,19 +1937,19 @@ codeunit 134685 "Email Test" // [Scenario] Replying to an email with a V4 connector should succeed with no errors // [Given] An email account with a V4 connector ConnectorMock.Initialize(); - ConnectorMock.AddAccount(EmailAccount, Enum::"Email Connector"::"Test Email Connector v4"); + ConnectorMock.AddAccount(TempEmailAccount, Enum::"Email Connector"::"Test Email Connector v4"); CreateEmailReply(EmailMessage, ''); // [When] Reply to email // [Then] No error occurs and reply returns true - asserterror Email.EnqueueReply(EmailMessage, EmailAccount."Account Id", EmailAccount.Connector, EmailOutbox); + asserterror Email.EnqueueReply(EmailMessage, TempEmailAccount."Account Id", TempEmailAccount.Connector, EmailOutbox); Assert.ExpectedError('You must specify a valid email account to send the message to'); end; [Test] procedure EnqueueReplyAllToEmailWithV1Connector() var - EmailAccount: Record "Email Account"; + TempEmailAccount: Record "Email Account"; EmailOutbox: Record "Email Outbox"; EmailMessage: Codeunit "Email Message"; ConnectorMock: Codeunit "Connector Mock"; @@ -1957,12 +1957,12 @@ codeunit 134685 "Email Test" // [Scenario] Replying to an email with a V1 connector should fail // [Given] An email account with a V1 connector ConnectorMock.Initialize(); - ConnectorMock.AddAccount(EmailAccount); + ConnectorMock.AddAccount(TempEmailAccount); CreateEmailReplyAll(EmailMessage); // [When] Reply to email // [Then] An error is thrown that the connector does not support this operation - asserterror Email.EnqueueReplyAll(EmailMessage, EmailAccount."Account Id", EmailAccount.Connector, EmailOutbox); + asserterror Email.EnqueueReplyAll(EmailMessage, TempEmailAccount."Account Id", TempEmailAccount.Connector, EmailOutbox); Assert.ExpectedError('The selected email connector does not support replying to emails'); end; @@ -1971,7 +1971,7 @@ codeunit 134685 "Email Test" [Obsolete('v2 connector is replaced by v3 connector.', '26.0')] procedure EnqueueReplyAllToEmailFail() var - EmailAccount: Record "Email Account"; + TempEmailAccount: Record "Email Account"; EmailOutbox: Record "Email Outbox"; EmailMessage: Codeunit "Email Message"; ConnectorMock: Codeunit "Connector Mock"; @@ -1979,7 +1979,7 @@ codeunit 134685 "Email Test" // [Scenario] Replying to an email with a V2 connector fails due to some error // [Given] An email account with a V2 connector ConnectorMock.Initialize(); - ConnectorMock.AddAccount(EmailAccount, Enum::"Email Connector"::"Test Email Connector v2"); + ConnectorMock.AddAccount(TempEmailAccount, Enum::"Email Connector"::"Test Email Connector v2"); CreateEmailReplyAll(EmailMessage); // [Given] Force the connector to fail on reply @@ -1987,14 +1987,14 @@ codeunit 134685 "Email Test" // [When] Reply to email // [Then] No error occurs and reply returns true - Email.EnqueueReplyAll(EmailMessage, EmailAccount."Account Id", EmailAccount.Connector, EmailOutbox); + Email.EnqueueReplyAll(EmailMessage, TempEmailAccount."Account Id", TempEmailAccount.Connector, EmailOutbox); end; #endif [Test] procedure EnqueueReplyAllToEmailFailv4() var - EmailAccount: Record "Email Account"; + TempEmailAccount: Record "Email Account"; EmailOutbox: Record "Email Outbox"; EmailMessage: Codeunit "Email Message"; ConnectorMock: Codeunit "Connector Mock"; @@ -2002,7 +2002,7 @@ codeunit 134685 "Email Test" // [Scenario] Replying to an email with a V4 connector fails due to some error // [Given] An email account with a V4 connector ConnectorMock.Initialize(); - ConnectorMock.AddAccount(EmailAccount, Enum::"Email Connector"::"Test Email Connector v4"); + ConnectorMock.AddAccount(TempEmailAccount, Enum::"Email Connector"::"Test Email Connector v4"); CreateEmailReplyAll(EmailMessage); // [Given] Force the connector to fail on reply @@ -2010,7 +2010,7 @@ codeunit 134685 "Email Test" // [When] Reply to email // [Then] No error occurs and reply returns true - Email.EnqueueReplyAll(EmailMessage, EmailAccount."Account Id", EmailAccount.Connector, EmailOutbox); + Email.EnqueueReplyAll(EmailMessage, TempEmailAccount."Account Id", TempEmailAccount.Connector, EmailOutbox); end; local procedure CreateEmail(var EmailMessage: Codeunit "Email Message") diff --git a/src/System Application/Test/MCP/src/MCPConfigTest.Codeunit.al b/src/System Application/Test/MCP/src/MCPConfigTest.Codeunit.al index 2445095346..c70269917d 100644 --- a/src/System Application/Test/MCP/src/MCPConfigTest.Codeunit.al +++ b/src/System Application/Test/MCP/src/MCPConfigTest.Codeunit.al @@ -633,7 +633,7 @@ codeunit 130130 "MCP Config Test" procedure TestFindMissingObjectWarningsForConfiguration() var MCPConfigurationTool: Record "MCP Configuration Tool"; - MCPConfigWarning: Record "MCP Config Warning"; + TempMCPConfigWarning: Record "MCP Config Warning"; ConfigId: Guid; ToolId: Guid; begin @@ -645,21 +645,21 @@ codeunit 130130 "MCP Config Test" Commit(); // [WHEN] Find warnings for configuration is called - MCPConfig.FindWarningsForConfiguration(ConfigId, MCPConfigWarning); + MCPConfig.FindWarningsForConfiguration(ConfigId, TempMCPConfigWarning); // [THEN] Warning is created for the tool with non-existing object #pragma warning disable AA0210 - MCPConfigWarning.SetRange("Warning Type", MCPConfigWarning."Warning Type"::"Missing Object"); + TempMCPConfigWarning.SetRange("Warning Type", TempMCPConfigWarning."Warning Type"::"Missing Object"); #pragma warning restore AA0210 - MCPConfigWarning.SetRange("Tool Id", ToolId); - Assert.RecordCount(MCPConfigWarning, 1); + TempMCPConfigWarning.SetRange("Tool Id", ToolId); + Assert.RecordCount(TempMCPConfigWarning, 1); end; [Test] procedure TestApplyMissingObjectRecommendedAction() var MCPConfigurationTool: Record "MCP Configuration Tool"; - MCPConfigWarning: Record "MCP Config Warning"; + TempMCPConfigWarning: Record "MCP Config Warning"; ConfigId: Guid; ToolId: Guid; begin @@ -671,22 +671,22 @@ codeunit 130130 "MCP Config Test" Commit(); // [WHEN] Find warnings for configuration is called - MCPConfig.FindWarningsForConfiguration(ConfigId, MCPConfigWarning); + MCPConfig.FindWarningsForConfiguration(ConfigId, TempMCPConfigWarning); // [WHEN] Apply recommended action is called #pragma warning disable AA0210 - MCPConfigWarning.SetRange("Warning Type", MCPConfigWarning."Warning Type"::"Missing Object"); + TempMCPConfigWarning.SetRange("Warning Type", TempMCPConfigWarning."Warning Type"::"Missing Object"); #pragma warning restore AA0210 - MCPConfigWarning.SetRange("Tool Id", ToolId); - MCPConfigWarning.FindFirst(); - MCPConfig.ApplyRecommendedAction(MCPConfigWarning); + TempMCPConfigWarning.SetRange("Tool Id", ToolId); + TempMCPConfigWarning.FindFirst(); + MCPConfig.ApplyRecommendedAction(TempMCPConfigWarning); // [THEN] Warning is resolved after applying the recommended action #pragma warning disable AA0210 - MCPConfigWarning.SetRange("Warning Type", MCPConfigWarning."Warning Type"::"Missing Object"); + TempMCPConfigWarning.SetRange("Warning Type", TempMCPConfigWarning."Warning Type"::"Missing Object"); #pragma warning restore AA0210 - MCPConfigWarning.SetRange("Tool Id", ToolId); - Assert.RecordIsEmpty(MCPConfigWarning); + TempMCPConfigWarning.SetRange("Tool Id", ToolId); + Assert.RecordIsEmpty(TempMCPConfigWarning); // [THEN] Configuration tool is deleted MCPConfigurationTool.SetRange(SystemId, ToolId); @@ -697,7 +697,7 @@ codeunit 130130 "MCP Config Test" procedure TestFindMissingReadToolWarningsForConfiguration() var MCPConfigurationTool: Record "MCP Configuration Tool"; - MCPConfigWarning: Record "MCP Config Warning"; + TempMCPConfigWarning: Record "MCP Config Warning"; ConfigId: Guid; ToolId: Guid; begin @@ -711,21 +711,21 @@ codeunit 130130 "MCP Config Test" Commit(); // [WHEN] Find warnings for configuration is called - MCPConfig.FindWarningsForConfiguration(ConfigId, MCPConfigWarning); + MCPConfig.FindWarningsForConfiguration(ConfigId, TempMCPConfigWarning); // [THEN] Warning is created for the tool with missing read permission #pragma warning disable AA0210 - MCPConfigWarning.SetRange("Warning Type", MCPConfigWarning."Warning Type"::"Missing Read Tool"); + TempMCPConfigWarning.SetRange("Warning Type", TempMCPConfigWarning."Warning Type"::"Missing Read Tool"); #pragma warning restore AA0210 - MCPConfigWarning.SetRange("Tool Id", ToolId); - Assert.RecordCount(MCPConfigWarning, 1); + TempMCPConfigWarning.SetRange("Tool Id", ToolId); + Assert.RecordCount(TempMCPConfigWarning, 1); end; [Test] procedure TestApplyMissingReadToolRecommendedAction() var MCPConfigurationTool: Record "MCP Configuration Tool"; - MCPConfigWarning: Record "MCP Config Warning"; + TempMCPConfigWarning: Record "MCP Config Warning"; ConfigId: Guid; ToolId: Guid; begin @@ -739,22 +739,22 @@ codeunit 130130 "MCP Config Test" Commit(); // [WHEN] Find warnings for configuration is called - MCPConfig.FindWarningsForConfiguration(ConfigId, MCPConfigWarning); + MCPConfig.FindWarningsForConfiguration(ConfigId, TempMCPConfigWarning); // [WHEN] Apply recommended action is called #pragma warning disable AA0210 - MCPConfigWarning.SetRange("Warning Type", MCPConfigWarning."Warning Type"::"Missing Read Tool"); + TempMCPConfigWarning.SetRange("Warning Type", TempMCPConfigWarning."Warning Type"::"Missing Read Tool"); #pragma warning restore AA0210 - MCPConfigWarning.SetRange("Tool Id", ToolId); - MCPConfigWarning.FindFirst(); - MCPConfig.ApplyRecommendedAction(MCPConfigWarning); + TempMCPConfigWarning.SetRange("Tool Id", ToolId); + TempMCPConfigWarning.FindFirst(); + MCPConfig.ApplyRecommendedAction(TempMCPConfigWarning); // [THEN] Warning is resolved after applying the recommended action #pragma warning disable AA0210 - MCPConfigWarning.SetRange("Warning Type", MCPConfigWarning."Warning Type"::"Missing Read Tool"); + TempMCPConfigWarning.SetRange("Warning Type", TempMCPConfigWarning."Warning Type"::"Missing Read Tool"); #pragma warning restore AA0210 - MCPConfigWarning.SetRange("Tool Id", ToolId); - Assert.RecordIsEmpty(MCPConfigWarning); + TempMCPConfigWarning.SetRange("Tool Id", ToolId); + Assert.RecordIsEmpty(TempMCPConfigWarning); // [THEN] Configuration tool has Allow Read enabled MCPConfigurationTool.GetBySystemId(ToolId); @@ -765,7 +765,7 @@ codeunit 130130 "MCP Config Test" procedure TestNoMissingReadToolWarningWhenReadEnabled() var MCPConfigurationTool: Record "MCP Configuration Tool"; - MCPConfigWarning: Record "MCP Config Warning"; + TempMCPConfigWarning: Record "MCP Config Warning"; ConfigId: Guid; ToolId: Guid; begin @@ -779,18 +779,18 @@ codeunit 130130 "MCP Config Test" Commit(); // [WHEN] Find warnings for configuration is called - MCPConfig.FindWarningsForConfiguration(ConfigId, MCPConfigWarning); + MCPConfig.FindWarningsForConfiguration(ConfigId, TempMCPConfigWarning); // [THEN] No Missing Read Tool warning is created - MCPConfigWarning.SetRange("Warning Type", MCPConfigWarning."Warning Type"::"Missing Read Tool"); - Assert.RecordIsEmpty(MCPConfigWarning); + TempMCPConfigWarning.SetRange("Warning Type", TempMCPConfigWarning."Warning Type"::"Missing Read Tool"); + Assert.RecordIsEmpty(TempMCPConfigWarning); end; [Test] procedure TestNoMissingReadToolWarningWhenModifyDisabled() var MCPConfigurationTool: Record "MCP Configuration Tool"; - MCPConfigWarning: Record "MCP Config Warning"; + TempMCPConfigWarning: Record "MCP Config Warning"; ConfigId: Guid; ToolId: Guid; begin @@ -804,11 +804,11 @@ codeunit 130130 "MCP Config Test" Commit(); // [WHEN] Find warnings for configuration is called - MCPConfig.FindWarningsForConfiguration(ConfigId, MCPConfigWarning); + MCPConfig.FindWarningsForConfiguration(ConfigId, TempMCPConfigWarning); // [THEN] No Missing Read Tool warning is created - MCPConfigWarning.SetRange("Warning Type", MCPConfigWarning."Warning Type"::"Missing Read Tool"); - Assert.RecordIsEmpty(MCPConfigWarning); + TempMCPConfigWarning.SetRange("Warning Type", TempMCPConfigWarning."Warning Type"::"Missing Read Tool"); + Assert.RecordIsEmpty(TempMCPConfigWarning); end; [Test] diff --git a/src/System Application/Test/Performance Profiler/src/ProfilingDataProcessorTest.Codeunit.al b/src/System Application/Test/Performance Profiler/src/ProfilingDataProcessorTest.Codeunit.al index ee2ae7b744..eed22319bf 100644 --- a/src/System Application/Test/Performance Profiler/src/ProfilingDataProcessorTest.Codeunit.al +++ b/src/System Application/Test/Performance Profiler/src/ProfilingDataProcessorTest.Codeunit.al @@ -21,14 +21,14 @@ codeunit 135014 "Profiling Data Processor Test" [Test] procedure TestIsInitialized() var - EmptyProfilingNode: Record "Profiling Node"; + TempEmptyProfilingNode: Record "Profiling Node"; begin // [WHEN] The performance profiler processor has not been initialized. // [THEN] The performance profiler processor is not initialized. Assert.IsFalse(PerfProfilerTestLibrary.IsInitialized(), 'The performance profiler processor is initialized before Initialize was called.'); // [WHEN] The performance profiler processor has been initialized with empty records. - PerfProfilerTestLibrary.Initialize(EmptyProfilingNode, EmptyProfilingNode); + PerfProfilerTestLibrary.Initialize(TempEmptyProfilingNode, TempEmptyProfilingNode); // [THEN] The performance profiler processor is not initialized. Assert.IsFalse(PerfProfilerTestLibrary.IsInitialized(), 'The performance profiler processor is initialized, even though it has no data.'); @@ -54,32 +54,32 @@ codeunit 135014 "Profiling Data Processor Test" [Test] procedure TestGetUniqueIdentifierByAggregationType() var - ProfilingNode: Record "Profiling Node"; + TempProfilingNode: Record "Profiling Node"; begin // [GIVEN] A test profiler node. - PerfProfilerTestLibrary.InsertProfilingNode(ProfilingNode, + PerfProfilerTestLibrary.InsertProfilingNode(TempProfilingNode, SessionId(), 1, 1, 'Codeunit', 1, 'CodeUnit_TestNode1', 'TestNode1App', 'TestPublisher1', 0, 'TestNode1FunctionName', 0, 0, 0); // [THEN] Getting a unique identifier from the node returns the correct result for every supported aggregation type. - Assert.AreEqual('TestNode1App', PerfProfilerTestLibrary.GetUniqueIdentifierByAggregationType(ProfilingNode, Enum::"Test Prof. Aggregation Type"::"App Name"), 'Incorrect app name.'); - Assert.AreEqual('TestPublisher1', PerfProfilerTestLibrary.GetUniqueIdentifierByAggregationType(ProfilingNode, Enum::"Test Prof. Aggregation Type"::"App Publisher"), 'Incorrect app publisher.'); - Assert.AreEqual('Codeunit1TestNode1FunctionName', PerfProfilerTestLibrary.GetUniqueIdentifierByAggregationType(ProfilingNode, Enum::"Test Prof. Aggregation Type"::Method), 'Incorrect method name.'); - Assert.AreEqual('Codeunit1', PerfProfilerTestLibrary.GetUniqueIdentifierByAggregationType(ProfilingNode, Enum::"Test Prof. Aggregation Type"::Object), 'Incorrect app object.'); + Assert.AreEqual('TestNode1App', PerfProfilerTestLibrary.GetUniqueIdentifierByAggregationType(TempProfilingNode, Enum::"Test Prof. Aggregation Type"::"App Name"), 'Incorrect app name.'); + Assert.AreEqual('TestPublisher1', PerfProfilerTestLibrary.GetUniqueIdentifierByAggregationType(TempProfilingNode, Enum::"Test Prof. Aggregation Type"::"App Publisher"), 'Incorrect app publisher.'); + Assert.AreEqual('Codeunit1TestNode1FunctionName', PerfProfilerTestLibrary.GetUniqueIdentifierByAggregationType(TempProfilingNode, Enum::"Test Prof. Aggregation Type"::Method), 'Incorrect method name.'); + Assert.AreEqual('Codeunit1', PerfProfilerTestLibrary.GetUniqueIdentifierByAggregationType(TempProfilingNode, Enum::"Test Prof. Aggregation Type"::Object), 'Incorrect app object.'); end; [Test] procedure TestGetSelfTimeAggregateAppName() var - ProfilingNode: Record "Profiling Node"; - VerificationProfilingNode: Record "Profiling Node"; + TempProfilingNode: Record "Profiling Node"; + TempVerificationProfilingNode: Record "Profiling Node"; begin // [GIVEN] Expected profile nodes - PerfProfilerTestLibrary.InsertProfilingNode(VerificationProfilingNode, + PerfProfilerTestLibrary.InsertProfilingNode(TempVerificationProfilingNode, SessionId(), 2, 2, 'Codeunit', 2, 'CodeUnit_TestNode2', 'TestNode2App', 'TestPublisher2', 0, 'TestNode2FunctionName', 200, 0, 0); - PerfProfilerTestLibrary.InsertProfilingNode(VerificationProfilingNode, + PerfProfilerTestLibrary.InsertProfilingNode(TempVerificationProfilingNode, SessionId(), 3, 2, 'Codeunit', 3, 'CodeUnit_TestNode3', 'TestNode3App', 'TestPublisher1', 0, 'TestNode3FunctionName', 1000, 0, 0); @@ -87,10 +87,10 @@ codeunit 135014 "Profiling Data Processor Test" PerfProfilerTestLibrary.Initialize(); // [WHEN] The self time aggregate is retrieved - PerfProfilerTestLibrary.GetSelfTimeAggregate(ProfilingNode, Enum::"Test Prof. Aggregation Type"::"App Name"); + PerfProfilerTestLibrary.GetSelfTimeAggregate(TempProfilingNode, Enum::"Test Prof. Aggregation Type"::"App Name"); // [THEN] Every node is as expected - Assert.IsTrue(PerfProfilerTestLibrary.AreEqual(VerificationProfilingNode, ProfilingNode), 'The profiling nodes are not equal to expected ones.'); + Assert.IsTrue(PerfProfilerTestLibrary.AreEqual(TempVerificationProfilingNode, TempProfilingNode), 'The profiling nodes are not equal to expected ones.'); PerfProfilerTestLibrary.ClearData(); end; @@ -98,15 +98,15 @@ codeunit 135014 "Profiling Data Processor Test" [Test] procedure TestGetSelfTimeAggregateAppPublisher() var - ProfilingNode: Record "Profiling Node"; - VerificationProfilingNode: Record "Profiling Node"; + TempProfilingNode: Record "Profiling Node"; + TempVerificationProfilingNode: Record "Profiling Node"; begin // [GIVEN] Expected profile nodes - PerfProfilerTestLibrary.InsertProfilingNode(VerificationProfilingNode, + PerfProfilerTestLibrary.InsertProfilingNode(TempVerificationProfilingNode, SessionId(), 2, 2, 'Codeunit', 2, 'CodeUnit_TestNode2', 'TestNode2App', 'TestPublisher2', 0, 'TestNode2FunctionName', 200, 0, 0); - PerfProfilerTestLibrary.InsertProfilingNode(VerificationProfilingNode, + PerfProfilerTestLibrary.InsertProfilingNode(TempVerificationProfilingNode, SessionId(), 3, 2, 'Codeunit', 3, 'CodeUnit_TestNode3', 'TestNode3App', 'TestPublisher1', 0, 'TestNode3FunctionName', 1000, 0, 0); @@ -114,10 +114,10 @@ codeunit 135014 "Profiling Data Processor Test" PerfProfilerTestLibrary.Initialize(); // [WHEN] The self time aggregate is retrieved - PerfProfilerTestLibrary.GetSelfTimeAggregate(ProfilingNode, Enum::"Test Prof. Aggregation Type"::"App Publisher"); + PerfProfilerTestLibrary.GetSelfTimeAggregate(TempProfilingNode, Enum::"Test Prof. Aggregation Type"::"App Publisher"); // [THEN] Every node is as expected - Assert.IsTrue(PerfProfilerTestLibrary.AreEqual(VerificationProfilingNode, ProfilingNode), 'The profiling nodes are not equal to expected ones.'); + Assert.IsTrue(PerfProfilerTestLibrary.AreEqual(TempVerificationProfilingNode, TempProfilingNode), 'The profiling nodes are not equal to expected ones.'); PerfProfilerTestLibrary.ClearData(); end; @@ -125,12 +125,12 @@ codeunit 135014 "Profiling Data Processor Test" [Test] procedure TestGetSelfTimeAggregateWithFilterAppName() var - ProfilingNode: Record "Profiling Node"; - VerificationProfilingNode: Record "Profiling Node"; + TempProfilingNode: Record "Profiling Node"; + TempVerificationProfilingNode: Record "Profiling Node"; TableViewFilter: Text; begin // [GIVEN] Expected profile nodes - PerfProfilerTestLibrary.InsertProfilingNode(VerificationProfilingNode, + PerfProfilerTestLibrary.InsertProfilingNode(TempVerificationProfilingNode, SessionId(), 3, 2, 'Codeunit', 3, 'CodeUnit_TestNode3', 'TestNode3App', 'TestPublisher1', 0, 'TestNode3FunctionName', 1000, 0, 0); @@ -141,10 +141,10 @@ codeunit 135014 "Profiling Data Processor Test" PerfProfilerTestLibrary.Initialize(); // [WHEN] The self time aggregate is retrieved - PerfProfilerTestLibrary.GetSelfTimeAggregate(ProfilingNode, Enum::"Test Prof. Aggregation Type"::"App Name", TableViewFilter); + PerfProfilerTestLibrary.GetSelfTimeAggregate(TempProfilingNode, Enum::"Test Prof. Aggregation Type"::"App Name", TableViewFilter); // [THEN] Every node is as expected - Assert.IsTrue(PerfProfilerTestLibrary.AreEqual(VerificationProfilingNode, ProfilingNode), 'The profiling nodes are not equal to expected ones.'); + Assert.IsTrue(PerfProfilerTestLibrary.AreEqual(TempVerificationProfilingNode, TempProfilingNode), 'The profiling nodes are not equal to expected ones.'); PerfProfilerTestLibrary.ClearData(); end; @@ -152,31 +152,31 @@ codeunit 135014 "Profiling Data Processor Test" [Test] procedure TestGetFullTimeNoAggregate() var - ProfilingNode: Record "Profiling Node"; - VerificationProfilingNode: Record "Profiling Node"; + TempProfilingNode: Record "Profiling Node"; + TempVerificationProfilingNode: Record "Profiling Node"; begin // [GIVEN] Expected profile nodes - PerfProfilerTestLibrary.InsertProfilingNode(VerificationProfilingNode, + PerfProfilerTestLibrary.InsertProfilingNode(TempVerificationProfilingNode, SessionId(), 1, 1, 'Codeunit', 1, 'CodeUnit_TestNode1', 'TestNode1App', 'TestPublisher1', 0, 'TestNode1FunctionName', 0, 600, 0); - PerfProfilerTestLibrary.InsertProfilingNode(VerificationProfilingNode, + PerfProfilerTestLibrary.InsertProfilingNode(TempVerificationProfilingNode, SessionId(), 2, 1, 'Codeunit', 2, 'CodeUnit_TestNode2', 'TestNode2App', 'TestPublisher2', 0, 'TestNode2FunctionName', 100, 600, 1); - PerfProfilerTestLibrary.InsertProfilingNode(VerificationProfilingNode, + PerfProfilerTestLibrary.InsertProfilingNode(TempVerificationProfilingNode, SessionId(), 3, 1, 'Codeunit', 3, 'CodeUnit_TestNode3', 'TestNode3App', 'TestPublisher1', 0, 'TestNode3FunctionName', 500, 500, 2); - PerfProfilerTestLibrary.InsertProfilingNode(VerificationProfilingNode, + PerfProfilerTestLibrary.InsertProfilingNode(TempVerificationProfilingNode, SessionId(), 4, 1, 'Codeunit', 4, 'CodeUnit_TestNode4', 'TestNode4App', 'TestPublisher2', 0, 'TestNode4FunctionName', 0, 600, 0); - PerfProfilerTestLibrary.InsertProfilingNode(VerificationProfilingNode, + PerfProfilerTestLibrary.InsertProfilingNode(TempVerificationProfilingNode, SessionId(), 5, 1, 'Codeunit', 2, 'CodeUnit_TestNode2', 'TestNode2App', 'TestPublisher2', 0, 'TestNode2FunctionName', 100, 600, 1); - PerfProfilerTestLibrary.InsertProfilingNode(VerificationProfilingNode, + PerfProfilerTestLibrary.InsertProfilingNode(TempVerificationProfilingNode, SessionId(), 6, 1, 'Codeunit', 3, 'CodeUnit_TestNode3', 'TestNode3App', 'TestPublisher1', 0, 'TestNode3FunctionName', 500, 500, 2); @@ -184,10 +184,10 @@ codeunit 135014 "Profiling Data Processor Test" PerfProfilerTestLibrary.Initialize(); // [WHEN] The self time aggregate is retrieved - PerfProfilerTestLibrary.GetFullTimeAggregate(ProfilingNode, Enum::"Test Prof. Aggregation Type"::"None"); + PerfProfilerTestLibrary.GetFullTimeAggregate(TempProfilingNode, Enum::"Test Prof. Aggregation Type"::"None"); // [THEN] Every node is as expected - Assert.IsTrue(PerfProfilerTestLibrary.AreEqual(VerificationProfilingNode, ProfilingNode), 'The profiling nodes are not equal to expected ones.'); + Assert.IsTrue(PerfProfilerTestLibrary.AreEqual(TempVerificationProfilingNode, TempProfilingNode), 'The profiling nodes are not equal to expected ones.'); PerfProfilerTestLibrary.ClearData(); end; @@ -195,23 +195,23 @@ codeunit 135014 "Profiling Data Processor Test" [Test] procedure TestGetFullTimeAggregateAppName() var - ProfilingNode: Record "Profiling Node"; - VerificationProfilingNode: Record "Profiling Node"; + TempProfilingNode: Record "Profiling Node"; + TempVerificationProfilingNode: Record "Profiling Node"; begin // [GIVEN] Expected profile nodes - PerfProfilerTestLibrary.InsertProfilingNode(VerificationProfilingNode, + PerfProfilerTestLibrary.InsertProfilingNode(TempVerificationProfilingNode, SessionId(), 1, 1, 'Codeunit', 1, 'CodeUnit_TestNode1', 'TestNode1App', 'TestPublisher1', 0, 'TestNode1FunctionName', 0, 600, 0); - PerfProfilerTestLibrary.InsertProfilingNode(VerificationProfilingNode, + PerfProfilerTestLibrary.InsertProfilingNode(TempVerificationProfilingNode, SessionId(), 2, 1, 'Codeunit', 2, 'CodeUnit_TestNode2', 'TestNode2App', 'TestPublisher2', 0, 'TestNode2FunctionName', 100, 1200, 1); - PerfProfilerTestLibrary.InsertProfilingNode(VerificationProfilingNode, + PerfProfilerTestLibrary.InsertProfilingNode(TempVerificationProfilingNode, SessionId(), 3, 1, 'Codeunit', 3, 'CodeUnit_TestNode3', 'TestNode3App', 'TestPublisher1', 0, 'TestNode3FunctionName', 500, 1000, 2); - PerfProfilerTestLibrary.InsertProfilingNode(VerificationProfilingNode, + PerfProfilerTestLibrary.InsertProfilingNode(TempVerificationProfilingNode, SessionId(), 4, 1, 'Codeunit', 4, 'CodeUnit_TestNode4', 'TestNode4App', 'TestPublisher2', 0, 'TestNode4FunctionName', 0, 600, 0); @@ -219,10 +219,10 @@ codeunit 135014 "Profiling Data Processor Test" PerfProfilerTestLibrary.Initialize(); // [WHEN] The self time aggregate is retrieved - PerfProfilerTestLibrary.GetFullTimeAggregate(ProfilingNode, Enum::"Test Prof. Aggregation Type"::"App Name"); + PerfProfilerTestLibrary.GetFullTimeAggregate(TempProfilingNode, Enum::"Test Prof. Aggregation Type"::"App Name"); // [THEN] Every node is as expected - Assert.IsTrue(PerfProfilerTestLibrary.AreEqual(VerificationProfilingNode, ProfilingNode), 'The profiling nodes are not equal to expected ones.'); + Assert.IsTrue(PerfProfilerTestLibrary.AreEqual(TempVerificationProfilingNode, TempProfilingNode), 'The profiling nodes are not equal to expected ones.'); PerfProfilerTestLibrary.ClearData(); end; @@ -230,15 +230,15 @@ codeunit 135014 "Profiling Data Processor Test" [Test] procedure TestGetFullTimeAggregateAppPublisher() var - ProfilingNode: Record "Profiling Node"; - VerificationProfilingNode: Record "Profiling Node"; + TempProfilingNode: Record "Profiling Node"; + TempVerificationProfilingNode: Record "Profiling Node"; begin // [GIVEN] Expected profile nodes - PerfProfilerTestLibrary.InsertProfilingNode(VerificationProfilingNode, + PerfProfilerTestLibrary.InsertProfilingNode(TempVerificationProfilingNode, SessionId(), 1, 1, 'Codeunit', 1, 'CodeUnit_TestNode1', 'TestNode1App', 'TestPublisher1', 0, 'TestNode1FunctionName', 0, 1100, 0); - PerfProfilerTestLibrary.InsertProfilingNode(VerificationProfilingNode, + PerfProfilerTestLibrary.InsertProfilingNode(TempVerificationProfilingNode, SessionId(), 2, 1, 'Codeunit', 2, 'CodeUnit_TestNode2', 'TestNode2App', 'TestPublisher2', 0, 'TestNode2FunctionName', 100, 1200, 1); @@ -246,10 +246,10 @@ codeunit 135014 "Profiling Data Processor Test" PerfProfilerTestLibrary.Initialize(); // [WHEN] The self time aggregate is retrieved - PerfProfilerTestLibrary.GetFullTimeAggregate(ProfilingNode, Enum::"Test Prof. Aggregation Type"::"App Publisher"); + PerfProfilerTestLibrary.GetFullTimeAggregate(TempProfilingNode, Enum::"Test Prof. Aggregation Type"::"App Publisher"); // [THEN] Every node is as expected - Assert.IsTrue(PerfProfilerTestLibrary.AreEqual(VerificationProfilingNode, ProfilingNode), 'The profiling nodes are not equal to expected ones.'); + Assert.IsTrue(PerfProfilerTestLibrary.AreEqual(TempVerificationProfilingNode, TempProfilingNode), 'The profiling nodes are not equal to expected ones.'); PerfProfilerTestLibrary.ClearData(); end; diff --git a/src/System Application/Test/Performance Profiler/src/SamplingPerfProfilerTest.Codeunit.al b/src/System Application/Test/Performance Profiler/src/SamplingPerfProfilerTest.Codeunit.al index 8a6a8de410..051c3ff147 100644 --- a/src/System Application/Test/Performance Profiler/src/SamplingPerfProfilerTest.Codeunit.al +++ b/src/System Application/Test/Performance Profiler/src/SamplingPerfProfilerTest.Codeunit.al @@ -35,10 +35,10 @@ codeunit 135013 "Sampling Perf. Profiler Test" [Test] procedure TestGetProfilingCallTreeFailsWhenNoDataIsSet() var - ProfilingNode: Record "Profiling Node"; + TempProfilingNode: Record "Profiling Node"; begin // [WHEN] GetProfilingCallTree is called on Sampling Performance Profiler with no data. - asserterror SamplingPerformanceProfiler.GetProfilingCallTree(ProfilingNode); + asserterror SamplingPerformanceProfiler.GetProfilingCallTree(TempProfilingNode); // [THEN] The no data error is thrown. Assert.ExpectedError(NoRecordingErr); @@ -47,10 +47,10 @@ codeunit 135013 "Sampling Perf. Profiler Test" [Test] procedure TesGetProfilingNodesFailsWhenNoDataIsSet() var - ProfilingNode: Record "Profiling Node"; + TempProfilingNode: Record "Profiling Node"; begin // [WHEN] GetProfilingCallTree is called on Sampling Performance Profiler with no data. - asserterror SamplingPerformanceProfiler.GetProfilingNodes(ProfilingNode); + asserterror SamplingPerformanceProfiler.GetProfilingNodes(TempProfilingNode); // [THEN] The no data error is thrown. Assert.ExpectedError(NoRecordingErr); @@ -146,41 +146,41 @@ codeunit 135013 "Sampling Perf. Profiler Test" [Test] procedure TestGetProfilingNodes() var - ProfilingNode: Record "Profiling Node"; - VerificationProfilingNode: Record "Profiling Node"; + TempProfilingNode: Record "Profiling Node"; + TempVerificationProfilingNode: Record "Profiling Node"; begin // [GIVEN] Test profile nodes - PerfProfilerTestLibrary.InsertProfilingNode(VerificationProfilingNode, + PerfProfilerTestLibrary.InsertProfilingNode(TempVerificationProfilingNode, SessionId(), 1, 1, 'Codeunit', 1, 'CodeUnit_TestNode1', 'TestNode1App', 'TestPublisher1', 0, 'TestNode1FunctionName', 0, 0, 0); - PerfProfilerTestLibrary.InsertProfilingNode(VerificationProfilingNode, + PerfProfilerTestLibrary.InsertProfilingNode(TempVerificationProfilingNode, SessionId(), 2, 1, 'Codeunit', 2, 'CodeUnit_TestNode2', 'TestNode2App', 'TestPublisher2', 0, 'TestNode2FunctionName', 100, 0, 0); - PerfProfilerTestLibrary.InsertProfilingNode(VerificationProfilingNode, + PerfProfilerTestLibrary.InsertProfilingNode(TempVerificationProfilingNode, SessionId(), 3, 1, 'Codeunit', 3, 'CodeUnit_TestNode3', 'TestNode3App', 'TestPublisher1', 0, 'TestNode3FunctionName', 500, 0, 0); - PerfProfilerTestLibrary.InsertProfilingNode(VerificationProfilingNode, + PerfProfilerTestLibrary.InsertProfilingNode(TempVerificationProfilingNode, SessionId(), 4, 1, 'Codeunit', 4, 'CodeUnit_TestNode4', 'TestNode4App', 'TestPublisher2', 0, 'TestNode4FunctionName', 0, 0, 0); - PerfProfilerTestLibrary.InsertProfilingNode(VerificationProfilingNode, + PerfProfilerTestLibrary.InsertProfilingNode(TempVerificationProfilingNode, SessionId(), 5, 1, 'Codeunit', 2, 'CodeUnit_TestNode2', 'TestNode2App', 'TestPublisher2', 0, 'TestNode2FunctionName', 100, 0, 0); - PerfProfilerTestLibrary.InsertProfilingNode(VerificationProfilingNode, + PerfProfilerTestLibrary.InsertProfilingNode(TempVerificationProfilingNode, SessionId(), 6, 1, 'Codeunit', 3, 'CodeUnit_TestNode3', 'TestNode3App', 'TestPublisher1', 0, 'TestNode3FunctionName', 500, 0, 0); // [GIVEN] Performance profiler is initialized with the test profile PerfProfilerTestLibrary.Initialize(); // [WHEN] Profiling nodes are retrieved from the profiler - SamplingPerformanceProfiler.GetProfilingNodes(ProfilingNode); + SamplingPerformanceProfiler.GetProfilingNodes(TempProfilingNode); // [THEN] Every node is as expected - Assert.IsTrue(PerfProfilerTestLibrary.AreEqual(VerificationProfilingNode, ProfilingNode), 'The profiling nodes are not equal to expected ones.'); + Assert.IsTrue(PerfProfilerTestLibrary.AreEqual(TempVerificationProfilingNode, TempProfilingNode), 'The profiling nodes are not equal to expected ones.'); PerfProfilerTestLibrary.ClearData(); end; @@ -188,31 +188,31 @@ codeunit 135013 "Sampling Perf. Profiler Test" [Test] procedure TestGetProfilingCallTree() var - CallTreeProfilingNode: Record "Profiling Node"; - VerificationProfilingNode: Record "Profiling Node"; + TempCallTreeProfilingNode: Record "Profiling Node"; + TempVerificationProfilingNode: Record "Profiling Node"; begin // [GIVEN] Test profile nodes (in the call tree form) - PerfProfilerTestLibrary.InsertProfilingNode(VerificationProfilingNode, + PerfProfilerTestLibrary.InsertProfilingNode(TempVerificationProfilingNode, SessionId(), 1, 1, 'Codeunit', 1, 'CodeUnit_TestNode1', 'TestNode1App', 'TestPublisher1', 0, 'TestNode1FunctionName', 0, 600, 0); - PerfProfilerTestLibrary.InsertProfilingNode(VerificationProfilingNode, + PerfProfilerTestLibrary.InsertProfilingNode(TempVerificationProfilingNode, SessionId(), 2, 1, 'Codeunit', 2, 'CodeUnit_TestNode2', 'TestNode2App', 'TestPublisher2', 0, 'TestNode2FunctionName', 100, 600, 1); - PerfProfilerTestLibrary.InsertProfilingNode(VerificationProfilingNode, + PerfProfilerTestLibrary.InsertProfilingNode(TempVerificationProfilingNode, SessionId(), 3, 1, 'Codeunit', 3, 'CodeUnit_TestNode3', 'TestNode3App', 'TestPublisher1', 0, 'TestNode3FunctionName', 500, 500, 2); - PerfProfilerTestLibrary.InsertProfilingNode(VerificationProfilingNode, + PerfProfilerTestLibrary.InsertProfilingNode(TempVerificationProfilingNode, SessionId(), 4, 1, 'Codeunit', 4, 'CodeUnit_TestNode4', 'TestNode4App', 'TestPublisher2', 0, 'TestNode4FunctionName', 0, 600, 0); - PerfProfilerTestLibrary.InsertProfilingNode(VerificationProfilingNode, + PerfProfilerTestLibrary.InsertProfilingNode(TempVerificationProfilingNode, SessionId(), 5, 1, 'Codeunit', 2, 'CodeUnit_TestNode2', 'TestNode2App', 'TestPublisher2', 0, 'TestNode2FunctionName', 100, 600, 1); - PerfProfilerTestLibrary.InsertProfilingNode(VerificationProfilingNode, + PerfProfilerTestLibrary.InsertProfilingNode(TempVerificationProfilingNode, SessionId(), 6, 1, 'Codeunit', 3, 'CodeUnit_TestNode3', 'TestNode3App', 'TestPublisher1', 0, 'TestNode3FunctionName', 500, 500, 2); @@ -220,10 +220,10 @@ codeunit 135013 "Sampling Perf. Profiler Test" PerfProfilerTestLibrary.Initialize(); // [WHEN] Profiling call tree nodes are retrieved from the profiler - SamplingPerformanceProfiler.GetProfilingCallTree(CallTreeProfilingNode); + SamplingPerformanceProfiler.GetProfilingCallTree(TempCallTreeProfilingNode); // [THEN] Every node is as expected - Assert.IsTrue(PerfProfilerTestLibrary.AreEqual(VerificationProfilingNode, CallTreeProfilingNode), 'The profiling nodes are not equal to expected ones.'); + Assert.IsTrue(PerfProfilerTestLibrary.AreEqual(TempVerificationProfilingNode, TempCallTreeProfilingNode), 'The profiling nodes are not equal to expected ones.'); PerfProfilerTestLibrary.ClearData(); end; @@ -231,7 +231,7 @@ codeunit 135013 "Sampling Perf. Profiler Test" [Test] procedure GetProfilingCallTreeWithMultipleChildNodes() var - ProfilingNode: Record "Profiling Node"; + TempProfilingNode: Record "Profiling Node"; begin // [SCENARIO] GetProfilingCallTree with multiple child nodes belonging to the same parent node @@ -239,45 +239,45 @@ codeunit 135013 "Sampling Perf. Profiler Test" PerfProfilerTestLibrary.Initialize(PerfProfilerTestLibrary.GetPerformanceProfileWithMultipleChildNodes()); // [WHEN] Call GetProfilingCallTree - SamplingPerformanceProfiler.GetProfilingCallTree(ProfilingNode); + SamplingPerformanceProfiler.GetProfilingCallTree(TempProfilingNode); // [THEN] Call tree is propoerly aligned: 3 nodes are at the indentation level 1, 3 nodes at level 3 - ProfilingNode.SetRange(Indentation, 1); - Assert.AreEqual(3, ProfilingNode.Count(), ProfilingNodeCountErr); + TempProfilingNode.SetRange(Indentation, 1); + Assert.AreEqual(3, TempProfilingNode.Count(), ProfilingNodeCountErr); - ProfilingNode.FindSet(); - VerifyProfilingNode(ProfilingNode, 'TestNode2FunctionName', 0, 219, 1); + TempProfilingNode.FindSet(); + VerifyProfilingNode(TempProfilingNode, 'TestNode2FunctionName', 0, 219, 1); - ProfilingNode.Next(); - VerifyProfilingNode(ProfilingNode, 'TestNode5FunctionName', 210, 210, 2); + TempProfilingNode.Next(); + VerifyProfilingNode(TempProfilingNode, 'TestNode5FunctionName', 210, 210, 2); - ProfilingNode.Next(); - VerifyProfilingNode(ProfilingNode, 'TestNode7FunctionName', 0, 429, 1); + TempProfilingNode.Next(); + VerifyProfilingNode(TempProfilingNode, 'TestNode7FunctionName', 0, 429, 1); - ProfilingNode.SetRange(Indentation, 3); - Assert.AreEqual(3, ProfilingNode.Count(), ProfilingNodeCountErr); + TempProfilingNode.SetRange(Indentation, 3); + Assert.AreEqual(3, TempProfilingNode.Count(), ProfilingNodeCountErr); - ProfilingNode.FindSet(); - VerifyProfilingNode(ProfilingNode, 'TestNode4FunctionName', 0, 0, 1); + TempProfilingNode.FindSet(); + VerifyProfilingNode(TempProfilingNode, 'TestNode4FunctionName', 0, 0, 1); - ProfilingNode.Next(); - VerifyProfilingNode(ProfilingNode, 'TestNode5FunctionName', 219, 219, 2); + TempProfilingNode.Next(); + VerifyProfilingNode(TempProfilingNode, 'TestNode5FunctionName', 219, 219, 2); - ProfilingNode.Next(); - VerifyProfilingNode(ProfilingNode, 'TestNode9FunctionName', 0, 0, 1); + TempProfilingNode.Next(); + VerifyProfilingNode(TempProfilingNode, 'TestNode9FunctionName', 0, 0, 1); - ProfilingNode.SetRange(Indentation, 3); - Assert.AreEqual(3, ProfilingNode.Count(), ProfilingNodeCountErr); + TempProfilingNode.SetRange(Indentation, 3); + Assert.AreEqual(3, TempProfilingNode.Count(), ProfilingNodeCountErr); PerfProfilerTestLibrary.ClearData(); end; - local procedure VerifyProfilingNode(ProfilingNode: Record "Profiling Node"; MethodName: Text; SelfTime: Duration; FullTime: Duration; HitCount: Integer) + local procedure VerifyProfilingNode(TempProfilingNode: Record "Profiling Node"; MethodName: Text; SelfTime: Duration; FullTime: Duration; HitCount: Integer) begin - Assert.AreEqual(MethodName, ProfilingNode."Method Name", ProfilingNodeNotMatchErr); - Assert.AreEqual(SelfTime, ProfilingNode."Self Time", ProfilingNodeNotMatchErr); - Assert.AreEqual(FullTime, ProfilingNode."Full Time", ProfilingNodeNotMatchErr); - Assert.AreEqual(HitCount, ProfilingNode."Hit Count", ProfilingNodeNotMatchErr); + Assert.AreEqual(MethodName, TempProfilingNode."Method Name", ProfilingNodeNotMatchErr); + Assert.AreEqual(SelfTime, TempProfilingNode."Self Time", ProfilingNodeNotMatchErr); + Assert.AreEqual(FullTime, TempProfilingNode."Full Time", ProfilingNodeNotMatchErr); + Assert.AreEqual(HitCount, TempProfilingNode."Hit Count", ProfilingNodeNotMatchErr); end; var diff --git a/src/System Application/Test/Permission Sets/src/PermissionRelationTests.Codeunit.al b/src/System Application/Test/Permission Sets/src/PermissionRelationTests.Codeunit.al index 9e80f7120d..2b2da6719a 100644 --- a/src/System Application/Test/Permission Sets/src/PermissionRelationTests.Codeunit.al +++ b/src/System Application/Test/Permission Sets/src/PermissionRelationTests.Codeunit.al @@ -845,7 +845,7 @@ codeunit 132438 "Permission Relation Tests" [ModalPageHandler] procedure LookupPermissionSetAModalHandler(var PermissionSetLookupList: TestPage "Permission Set Lookup List") var - PermissionSetBuffer: Record "PermissionSet Buffer"; + TempPermissionSetBuffer: Record "PermissionSet Buffer"; MetadataPermissionSet: Record "Metadata Permission Set"; AppId: Guid; begin @@ -853,11 +853,11 @@ codeunit 132438 "Permission Relation Tests" if MetadataPermissionSet.FindFirst() then AppId := MetadataPermissionSet."App ID"; - PermissionSetBuffer.Scope := PermissionSetBuffer.Scope::System; - PermissionSetBuffer."App ID" := AppId; - PermissionSetBuffer."Role ID" := RoleIdLbl; + TempPermissionSetBuffer.Scope := TempPermissionSetBuffer.Scope::System; + TempPermissionSetBuffer."App ID" := AppId; + TempPermissionSetBuffer."Role ID" := RoleIdLbl; - PermissionSetLookupList.GoToRecord(PermissionSetBuffer); + PermissionSetLookupList.GoToRecord(TempPermissionSetBuffer); PermissionSetLookupList.OK().Invoke(); end; diff --git a/src/System Application/Test/Record Selection/src/RecordSelectionTest.Codeunit.al b/src/System Application/Test/Record Selection/src/RecordSelectionTest.Codeunit.al index 6925fceed6..f37cf04e60 100644 --- a/src/System Application/Test/Record Selection/src/RecordSelectionTest.Codeunit.al +++ b/src/System Application/Test/Record Selection/src/RecordSelectionTest.Codeunit.al @@ -28,7 +28,7 @@ codeunit 135136 "Record Selection Test" [TransactionModel(TransactionModel::AutoRollback)] procedure RecordSelectionTest() var - RecordSelectionBuffer: Record "Record Selection Buffer"; + TempRecordSelectionBuffer: Record "Record Selection Buffer"; RecordSelection: Codeunit "Record Selection"; RecordSelected: Boolean; begin @@ -38,14 +38,14 @@ codeunit 135136 "Record Selection Test" PermissionsMock.Set('Rec. Selection Read'); // [WHEN] Open function is called and a record is selected. - RecordSelected := RecordSelection.Open(Database::"Record Selection Test Table", 1000, RecordSelectionBuffer); + RecordSelected := RecordSelection.Open(Database::"Record Selection Test Table", 1000, TempRecordSelectionBuffer); // [THEN] The third record is picked Assert.IsTrue(RecordSelected, 'No record was selected.'); - Assert.AreEqual('3', RecordSelectionBuffer."Field 1", 'The third record should have been picked.'); - Assert.AreEqual('C', RecordSelectionBuffer."Field 2", 'The third record should have been picked.'); - Assert.AreEqual('The third', RecordSelectionBuffer."Field 3", 'The third record should have been picked.'); - Assert.AreEqual(SystemId, RecordSelectionBuffer."Record System Id", 'The third record should have been picked.'); + Assert.AreEqual('3', TempRecordSelectionBuffer."Field 1", 'The third record should have been picked.'); + Assert.AreEqual('C', TempRecordSelectionBuffer."Field 2", 'The third record should have been picked.'); + Assert.AreEqual('The third', TempRecordSelectionBuffer."Field 3", 'The third record should have been picked.'); + Assert.AreEqual(SystemId, TempRecordSelectionBuffer."Record System Id", 'The third record should have been picked.'); end; [Test] @@ -53,7 +53,7 @@ codeunit 135136 "Record Selection Test" [TransactionModel(TransactionModel::AutoRollback)] procedure RecordSelectionSingleRecordTest() var - RecordSelectionBuffer: Record "Record Selection Buffer"; + TempRecordSelectionBuffer: Record "Record Selection Buffer"; RecordSelection: Codeunit "Record Selection"; RecordSelected: Boolean; begin @@ -63,11 +63,11 @@ codeunit 135136 "Record Selection Test" PermissionsMock.Set('Rec. Selection Read'); // [WHEN] Open function is called and a record is auto selected. - RecordSelected := RecordSelection.Open(Database::"Record Selection Test Table", 1000, RecordSelectionBuffer); + RecordSelected := RecordSelection.Open(Database::"Record Selection Test Table", 1000, TempRecordSelectionBuffer); // [THEN] The only record is picked Assert.IsTrue(RecordSelected, 'No record was selected.'); - Assert.AreEqual(SystemId, RecordSelectionBuffer."Record System Id", 'The first record should have been picked.'); + Assert.AreEqual(SystemId, TempRecordSelectionBuffer."Record System Id", 'The first record should have been picked.'); end; [Test] @@ -75,7 +75,7 @@ codeunit 135136 "Record Selection Test" [TransactionModel(TransactionModel::AutoRollback)] procedure RecordSelectionCancel() var - RecordSelectionBuffer: Record "Record Selection Buffer"; + TempRecordSelectionBuffer: Record "Record Selection Buffer"; RecordSelection: Codeunit "Record Selection"; RecordSelected: Boolean; begin @@ -85,7 +85,7 @@ codeunit 135136 "Record Selection Test" PermissionsMock.Set('Rec. Selection Read'); // [GIVEN] User selects Cancel // [THEN] Open function returns false - RecordSelected := RecordSelection.Open(Database::"Record Selection Test Table", 1000, RecordSelectionBuffer); + RecordSelected := RecordSelection.Open(Database::"Record Selection Test Table", 1000, TempRecordSelectionBuffer); Assert.IsFalse(RecordSelected, 'The open function returned true'); end; @@ -94,7 +94,7 @@ codeunit 135136 "Record Selection Test" [TransactionModel(TransactionModel::AutoRollback)] procedure RecordSelectionTooManyRecordsErrTest() var - RecordSelectionBuffer: Record "Record Selection Buffer"; + TempRecordSelectionBuffer: Record "Record Selection Buffer"; RecordSelection: Codeunit "Record Selection"; begin // [SCENARIO] The record selection page is opened but contains too many records so an error is thrown. @@ -103,7 +103,7 @@ codeunit 135136 "Record Selection Test" PermissionsMock.Set('Rec. Selection Read'); // [WHEN] Open function is called and errors - asserterror RecordSelection.Open(Database::"Record Selection Test Table", 2, RecordSelectionBuffer); + asserterror RecordSelection.Open(Database::"Record Selection Test Table", 2, TempRecordSelectionBuffer); // [THEN] An error is thrown that the table contains too many records Assert.ExpectedError(TooManyRecordsErr); @@ -113,7 +113,7 @@ codeunit 135136 "Record Selection Test" [TransactionModel(TransactionModel::AutoRollback)] procedure RecordSelectionNoRecordsErrTest() var - RecordSelectionBuffer: Record "Record Selection Buffer"; + TempRecordSelectionBuffer: Record "Record Selection Buffer"; RecordSelection: Codeunit "Record Selection"; begin // [SCENARIO] The record selection page is opened but contains no records so an error is thrown. @@ -121,7 +121,7 @@ codeunit 135136 "Record Selection Test" PermissionsMock.Set('Rec. Selection Read'); // [WHEN] Open function is called and errors - asserterror RecordSelection.Open(Database::"Record Selection Test Table", 1000, RecordSelectionBuffer); + asserterror RecordSelection.Open(Database::"Record Selection Test Table", 1000, TempRecordSelectionBuffer); // [THEN] An error is thrown that the table contains no records Assert.ExpectedError(NoRecordsErr); diff --git a/src/System Application/Test/Regex/src/RegexPerformanceTests.Codeunit.al b/src/System Application/Test/Regex/src/RegexPerformanceTests.Codeunit.al index 91458e74a4..f0ee2196e1 100644 --- a/src/System Application/Test/Regex/src/RegexPerformanceTests.Codeunit.al +++ b/src/System Application/Test/Regex/src/RegexPerformanceTests.Codeunit.al @@ -18,45 +18,45 @@ codeunit 135068 "Regex Performance Tests" [Test] procedure RegexPerformanceStaticCalls() var - RegexOptions: Record "Regex Options"; + TempRegexOptions: Record "Regex Options"; Regex: Codeunit Regex; begin - RegexOptions.Compiled := true; - RegexOptions.IgnoreCase := true; + TempRegexOptions.Compiled := true; + TempRegexOptions.IgnoreCase := true; - RegexPerformanceCall(Regex, RegexOptions, false); + RegexPerformanceCall(Regex, TempRegexOptions, false); end; [Test] procedure RegexPerformanceInstanceCalls() var - RegexOptions: Record "Regex Options"; + TempRegexOptions: Record "Regex Options"; Regex: Codeunit Regex; begin - RegexOptions.Compiled := true; - RegexOptions.IgnoreCase := true; - Regex.Regex(RegexPerformanceUrlMatchTxt, RegexOptions); + TempRegexOptions.Compiled := true; + TempRegexOptions.IgnoreCase := true; + Regex.Regex(RegexPerformanceUrlMatchTxt, TempRegexOptions); - RegexPerformanceCall(Regex, RegexOptions, true); + RegexPerformanceCall(Regex, TempRegexOptions, true); end; - local procedure RegexPerformanceCall(var ThisRegex: Codeunit Regex; RegexOptions: Record "Regex Options"; RunOnInstance: Boolean) + local procedure RegexPerformanceCall(var ThisRegex: Codeunit Regex; TempRegexOptions: Record "Regex Options"; RunOnInstance: Boolean) var - Matches: Record Matches; - Groups: Record Groups; + TempMatches: Record Matches; + TempGroups: Record Groups; Counter: Integer; UrlTxt: Label 'https://bcartifacts.azureedge.net/onprem/18.3.27240.27480/de', Locked = true; begin for counter := 0 to 100 do begin case RunOnInstance of true: - ThisRegex.Match(UrlTxt, Matches); + ThisRegex.Match(UrlTxt, TempMatches); false: - ThisRegex.Match(UrlTxt, RegexPerformanceUrlMatchTxt, RegexOptions, Matches); + ThisRegex.Match(UrlTxt, RegexPerformanceUrlMatchTxt, TempRegexOptions, TempMatches); end; - if Matches.Success then - ThisRegex.Groups(Matches, Groups); + if TempMatches.Success then + ThisRegex.Groups(TempMatches, TempGroups); end; end; diff --git a/src/System Application/Test/Regex/src/RegexTests.Codeunit.al b/src/System Application/Test/Regex/src/RegexTests.Codeunit.al index dba35c2310..c28f852544 100644 --- a/src/System Application/Test/Regex/src/RegexTests.Codeunit.al +++ b/src/System Application/Test/Regex/src/RegexTests.Codeunit.al @@ -24,146 +24,146 @@ codeunit 135057 RegexTests Pattern: Text; StartAt: Integer; begin - // [Given] A pattern that matches american phone numbers + // [Given] A pattern that TempMatches american phone numbers Pattern := '\G[a-zA-Z0-9]\d{2}[a-zA-Z0-9](-\d{3}){2}[A-Za-z0-9]$'; InstanceRegex.Regex(Pattern); // [Then] It returns true for an american number and false for a danish number - Assert.IsTrue(Regex.IsMatch('1298-673-4192', Pattern), 'Number does not match pattern'); - Assert.IsFalse(Regex.IsMatch('12 23 45 67', Pattern), 'Number wrongly matches pattern'); - Assert.IsTrue(InstanceRegex.IsMatch('1298-673-4192'), 'Number does not match pattern'); - Assert.IsFalse(InstanceRegex.IsMatch('12 23 45 67'), 'Number wrongly matches pattern'); + Assert.IsTrue(Regex.IsMatch('1298-673-4192', Pattern), 'Number does not TempMatch pattern'); + Assert.IsFalse(Regex.IsMatch('12 23 45 67', Pattern), 'Number wrongly TempMatches pattern'); + Assert.IsTrue(InstanceRegex.IsMatch('1298-673-4192'), 'Number does not TempMatch pattern'); + Assert.IsFalse(InstanceRegex.IsMatch('12 23 45 67'), 'Number wrongly TempMatches pattern'); // [When] Starting position is set to an index StartAt := 6; - // [Then] It only matches on string with that starting positon - Assert.IsFalse(Regex.IsMatch('Test: 1298-673-4192', Pattern), 'Number wrongly matches pattern'); - Assert.IsTrue(Regex.IsMatch('Test: 1298-673-4192', Pattern, StartAt), 'Number does not match pattern'); - Assert.IsFalse(InstanceRegex.IsMatch('Test: 1298-673-4192'), 'Number wrongly matches pattern'); - Assert.IsTrue(InstanceRegex.IsMatch('Test: 1298-673-4192', StartAt), 'Number does not match pattern'); + // [Then] It only TempMatches on string with that starting positon + Assert.IsFalse(Regex.IsMatch('Test: 1298-673-4192', Pattern), 'Number wrongly TempMatches pattern'); + Assert.IsTrue(Regex.IsMatch('Test: 1298-673-4192', Pattern, StartAt), 'Number does not TempMatch pattern'); + Assert.IsFalse(InstanceRegex.IsMatch('Test: 1298-673-4192'), 'Number wrongly TempMatches pattern'); + Assert.IsTrue(InstanceRegex.IsMatch('Test: 1298-673-4192', StartAt), 'Number does not TempMatch pattern'); end; [Test] procedure MatchPatternTest() var - Match: Record Matches; - RegexOptions: Record "Regex Options"; + TempMatch: Record Matches; + TempRegexOptions: Record "Regex Options"; Pattern: Text; begin - // [Given] A pattern that matches two words that are the same + // [Given] A pattern that TempMatches two words that are the same Pattern := '\b p \S*'; InstanceRegex.Regex(Pattern); - // [Then] Regex does match anything because of the whitespaces in - Assert.IsFalse(Regex.IsMatch('Empower every person and organization...', Pattern), 'Wrongly found a match'); - Assert.IsFalse(InstanceRegex.IsMatch('Empower every person and organization...'), 'Wrongly found a match'); + // [Then] Regex does TempMatch anything because of the whitespaces in + Assert.IsFalse(Regex.IsMatch('Empower every person and organization...', Pattern), 'Wrongly found a TempMatch'); + Assert.IsFalse(InstanceRegex.IsMatch('Empower every person and organization...'), 'Wrongly found a TempMatch'); - Regex.Match('Empower every person and organization...', Pattern, Match); - Assert.AreEqual('', Match.ReadValue(), 'Wrongly found a match, despite whitespace in pattern'); - InstanceRegex.Match('Empower every person and organization...', Match); - Assert.AreEqual('', Match.ReadValue(), 'Wrongly found a match, despite whitespace in pattern'); + Regex.Match('Empower every person and organization...', Pattern, TempMatch); + Assert.AreEqual('', TempMatch.ReadValue(), 'Wrongly found a TempMatch, despite whitespace in pattern'); + InstanceRegex.Match('Empower every person and organization...', TempMatch); + Assert.AreEqual('', TempMatch.ReadValue(), 'Wrongly found a TempMatch, despite whitespace in pattern'); // [When] Regex is initialized with pattern and IgnorePatternWhiteSpace option - RegexOptions.IgnorePatternWhitespace := true; + TempRegexOptions.IgnorePatternWhitespace := true; - // [Then] Regex matches with "person" - Assert.IsTrue(Regex.IsMatch('Empower every person and organization...', Pattern, RegexOptions), 'Did not find a match'); - Regex.Match('Empower every person and organization...', Pattern, RegexOptions, Match); - Assert.AreEqual('person', Match.ReadValue(), 'Did not match the right word'); + // [Then] Regex TempMatches with "person" + Assert.IsTrue(Regex.IsMatch('Empower every person and organization...', Pattern, TempRegexOptions), 'Did not find a TempMatch'); + Regex.Match('Empower every person and organization...', Pattern, TempRegexOptions, TempMatch); + Assert.AreEqual('person', TempMatch.ReadValue(), 'Did not TempMatch the right word'); // [When] Regex is initialized with pattern and IgnorePatternWhiteSpace option - InstanceRegex.Regex(Pattern, RegexOptions); + InstanceRegex.Regex(Pattern, TempRegexOptions); - // [Then] Regex matches with "person" - Assert.IsTrue(InstanceRegex.IsMatch('Empower every person and organization...'), 'Did not find a match'); - InstanceRegex.Match('Empower every person and organization...', Match); - Assert.AreEqual('person', Match.ReadValue(), 'Did not match the right word'); + // [Then] Regex TempMatches with "person" + Assert.IsTrue(InstanceRegex.IsMatch('Empower every person and organization...'), 'Did not find a TempMatch'); + InstanceRegex.Match('Empower every person and organization...', TempMatch); + Assert.AreEqual('person', TempMatch.ReadValue(), 'Did not TempMatch the right word'); end; [Test] procedure MatchesPatternTest() var - Matches: Record Matches; + TempMatches: Record Matches; Pattern: Text; begin - // [Given] A pattern that matches words ending with 'on' + // [Given] A pattern that TempMatches words ending with 'on' Pattern := '\b\w+on\b'; - // [When] Regex matches pattern - Regex.Match('Empower every person and every organization on the planet to achieve more.', Pattern, Matches); + // [When] Regex TempMatches pattern + Regex.Match('Empower every person and every organization on the planet to achieve more.', Pattern, TempMatches); - // [Then] Regex finds two words that match and the second one is 'organization'. - Assert.AreEqual(2, Matches.Count(), 'Did not match correct number of words on sentence'); - Assert.AreEqual('person', Matches.ReadValue(), 'Did not match the right words'); - Matches.Get(1); - Assert.AreEqual('organization', Matches.ReadValue(), Format(Matches.MatchIndex)); + // [Then] Regex finds two words that TempMatch and the second one is 'organization'. + Assert.AreEqual(2, TempMatches.Count(), 'Did not TempMatch correct number of words on sentence'); + Assert.AreEqual('person', TempMatches.ReadValue(), 'Did not TempMatch the right words'); + TempMatches.Get(1); + Assert.AreEqual('organization', TempMatches.ReadValue(), Format(TempMatches.MatchIndex)); - // [When] Regex matches pattern + // [When] Regex TempMatches pattern InstanceRegex.Regex(Pattern); - InstanceRegex.Match('Empower every person and every organization on the planet to achieve more.', Matches); + InstanceRegex.Match('Empower every person and every organization on the planet to achieve more.', TempMatches); - // [Then] Regex finds two words that match and the second one is 'organization'. - Assert.AreEqual(2, Matches.Count(), 'Did not match correct number of words on sentence'); - Assert.AreEqual('person', Matches.ReadValue(), 'Did not match the right words'); - Matches.Get(1); - Assert.AreEqual('organization', Matches.ReadValue(), Format(Matches.MatchIndex)); + // [Then] Regex finds two words that TempMatch and the second one is 'organization'. + Assert.AreEqual(2, TempMatches.Count(), 'Did not TempMatch correct number of words on sentence'); + Assert.AreEqual('person', TempMatches.ReadValue(), 'Did not TempMatch the right words'); + TempMatches.Get(1); + Assert.AreEqual('organization', TempMatches.ReadValue(), Format(TempMatches.MatchIndex)); end; local procedure RegexGroupsTestCheckGroups(var CheckMatches: Record Matches; var CheckGroups: Record Groups) begin - // [Then] Regex recognizes multiple Regex Groups on the first match "Microsoft®" - Assert.AreEqual('Microsoft®', CheckGroups.ReadValue(), 'Did not match first group item correctly'); + // [Then] Regex recognizes multiple Regex TempGroups on the first TempMatch "Microsoft®" + Assert.AreEqual('Microsoft®', CheckGroups.ReadValue(), 'Did not TempMatch first group item correctly'); Assert.AreEqual('0', CheckGroups.Name, 'Group name is wrong'); CheckGroups.Next(); - Assert.AreEqual('Microsoft', CheckGroups.ReadValue(), 'Did not match second group item correctly'); + Assert.AreEqual('Microsoft', CheckGroups.ReadValue(), 'Did not TempMatch second group item correctly'); Assert.AreEqual('1', CheckGroups.Name, 'Group name is wrong'); // [And] recognizes the next Regex Group as "Excel®" CheckMatches.Next(); Regex.Groups(CheckMatches, CheckGroups); - Assert.AreEqual('Excel®', CheckGroups.ReadValue(), 'Did not match first group item of second group correctly'); + Assert.AreEqual('Excel®', CheckGroups.ReadValue(), 'Did not TempMatch first group item of second group correctly'); CheckGroups.Next(); - Assert.AreEqual('Excel', CheckGroups.ReadValue(), 'Did not match first group item of second group correctly'); + Assert.AreEqual('Excel', CheckGroups.ReadValue(), 'Did not TempMatch first group item of second group correctly'); end; [Test] procedure RegexGroupsTest() var - Matches: Record Matches; - Groups: Record Groups; + TempMatches: Record Matches; + TempGroups: Record Groups; Pattern: Text; Input: Text; begin - // [Given] A pattern that matches Registered Trademark symbols + // [Given] A pattern that TempMatches Registered Trademark symbols Pattern := '\b(\w+?)([\u00AE\u2122])'; Input := 'Microsoft® Office Professional Edition combines several office productivity products, including Word, Excel®, Access®, Outlook®'; - // [When] Regex matches pattern, and the resulting MatchCollection is copied to an array - Regex.Match(Input, Pattern, Matches); - Regex.Groups(Matches, Groups); + // [When] Regex TempMatches pattern, and the resulting MatchCollection is copied to an array + Regex.Match(Input, Pattern, TempMatches); + Regex.Groups(TempMatches, TempGroups); // [Then] Checks are performed - RegexGroupsTestCheckGroups(Matches, Groups); + RegexGroupsTestCheckGroups(TempMatches, TempGroups); - // [When] Regex matches pattern, and the resulting MatchCollection is copied to an array + // [When] Regex TempMatches pattern, and the resulting MatchCollection is copied to an array InstanceRegex.Regex(Pattern); - InstanceRegex.Match(Input, Matches); - InstanceRegex.Groups(Matches, Groups); + InstanceRegex.Match(Input, TempMatches); + InstanceRegex.Groups(TempMatches, TempGroups); // [Then] Checks are performed - RegexGroupsTestCheckGroups(Matches, Groups); + RegexGroupsTestCheckGroups(TempMatches, TempGroups); end; [Test] procedure ReplacePatternTest() var - RegexOptions: Record "Regex Options"; + TempRegexOptions: Record "Regex Options"; Pattern: Text; begin - // [Given] A pattern that matches two words that are the same + // [Given] A pattern that TempMatches two words that are the same Pattern := '\b(?\w+)\s+(\k)\b'; InstanceRegex.Regex(Pattern); @@ -174,11 +174,11 @@ codeunit 135057 RegexTests Assert.AreEqual('This is a test', InstanceRegex.Replace('This is a test test', 'test'), 'Regex did not replace pattern'); // [When] Regex is initialized with pattern and Ignore Case option - RegexOptions.IgnoreCase := true; - InstanceRegex.Regex(Pattern, RegexOptions); + TempRegexOptions.IgnoreCase := true; + InstanceRegex.Regex(Pattern, TempRegexOptions); // [Then] Module replaces words that are the same (insensitive to casing) - Assert.AreEqual('This is a test', Regex.Replace('This is a Test test', Pattern, 'test', RegexOptions), 'Regex correctly replaced words with different casing'); + Assert.AreEqual('This is a test', Regex.Replace('This is a Test test', Pattern, 'test', TempRegexOptions), 'Regex correctly replaced words with different casing'); Assert.AreEqual('This is a test', InstanceRegex.Replace('This is a Test test', 'test'), 'Regex correctly replaced words with different casing'); end; @@ -190,7 +190,7 @@ codeunit 135057 RegexTests "Count": Integer; StartAt: Integer; begin - // [Given] A pattern that matches sequences of the same character, a replacement and count + // [Given] A pattern that TempMatches sequences of the same character, a replacement and count Pattern := '(.)\1+'; Replacement := '$1'; "Count" := 1; @@ -217,7 +217,7 @@ codeunit 135057 RegexTests "Count": Integer; StartAt: Integer; begin - // [Given] A pattern that matches sequences of lowercase letters + // [Given] A pattern that TempMatches sequences of lowercase letters Pattern := '[a-z]+'; "Count" := 2; StartAt := 6; @@ -278,7 +278,7 @@ codeunit 135057 RegexTests UnescapedString: Text; EscapedString: Text; begin - // [Given] A pattern that matches two words that are the same + // [Given] A pattern that TempMatches two words that are the same EscapedString := '\TEST "TEST"'; UnescapedString := '\\TEST\t"TEST"'; @@ -290,7 +290,7 @@ codeunit 135057 RegexTests [Test] procedure ECMAScriptRegexOptionTest() var - RegexOptions: Record "Regex Options"; + TempRegexOptions: Record "Regex Options"; Pattern: Text; Evaluator: Text; begin @@ -299,26 +299,26 @@ codeunit 135057 RegexTests Evaluator := 'æøå'; InstanceRegex.Regex(Pattern); - // [Then] It matches the string - Assert.IsTrue(Regex.IsMatch(Evaluator, Pattern), 'Did not match string of danish characters'); - Assert.IsTrue(InstanceRegex.IsMatch(Evaluator), 'Did not match string of danish characters'); + // [Then] It TempMatches the string + Assert.IsTrue(Regex.IsMatch(Evaluator, Pattern), 'Did not TempMatch string of danish characters'); + Assert.IsTrue(InstanceRegex.IsMatch(Evaluator), 'Did not TempMatch string of danish characters'); // [When] Running IsMatch with ECMAScript option - RegexOptions.ECMAScript := true; - InstanceRegex.Regex(Pattern, RegexOptions); + TempRegexOptions.ECMAScript := true; + InstanceRegex.Regex(Pattern, TempRegexOptions); - // [Then] It will not match anything - Assert.IsFalse(Regex.IsMatch(Evaluator, Pattern, RegexOptions), 'Wrongly matched string of danish characters'); + // [Then] It will not TempMatch anything + Assert.IsFalse(Regex.IsMatch(Evaluator, Pattern, TempRegexOptions), 'Wrongly matched string of danish characters'); Assert.IsFalse(InstanceRegex.IsMatch(Evaluator), 'Wrongly matched string of danish characters'); end; [Test] procedure ExplicitCaptureRegexOptionTest() var - Groups: Record Groups; - Matches: Record Matches; - Captures: Record Captures; - RegexOptions: Record "Regex Options"; + TempGroups: Record Groups; + TempMatches: Record Matches; + TempCaptures: Record Captures; + TempRegexOptions: Record "Regex Options"; Pattern: Text; Evaluator: Text; begin @@ -327,83 +327,83 @@ codeunit 135057 RegexTests Evaluator := 'This is a sentence.'; InstanceRegex.Regex(Pattern); - // [When] Running Matches, and extracting the captures in the first group of the first match. - Regex.Match(Evaluator, Pattern, Matches); - Regex.Groups(Matches, Groups); - Groups.Get(1); + // [When] Running TempMatches, and extracting the TempCaptures in the first group of the first TempMatch. + Regex.Match(Evaluator, Pattern, TempMatches); + Regex.Groups(TempMatches, TempGroups); + TempGroups.Get(1); - Regex.Captures(Groups, Captures); + Regex.Captures(TempGroups, TempCaptures); - // [Then] There are 2 GroupCollections, where the second one contains 4 captures (one for each word) - Assert.AreEqual(2, Groups.Count(), 'Did not find 2 groups'); - Assert.AreEqual(4, Captures.Count(), 'Did not find 4 captures'); + // [Then] There are 2 GroupCollections, where the second one contains 4 TempCaptures (one for each word) + Assert.AreEqual(2, TempGroups.Count(), 'Did not find 2 TempGroups'); + Assert.AreEqual(4, TempCaptures.Count(), 'Did not find 4 TempCaptures'); - // [When] Running Matches, and extracting the captures in the first group of the first match using the Regex pattern constructor. - InstanceRegex.Match(Evaluator, Matches); - Regex.Groups(Matches, Groups); - Groups.Get(1); + // [When] Running TempMatches, and extracting the TempCaptures in the first group of the first TempMatch using the Regex pattern constructor. + InstanceRegex.Match(Evaluator, TempMatches); + Regex.Groups(TempMatches, TempGroups); + TempGroups.Get(1); - Regex.Captures(Groups, Captures); + Regex.Captures(TempGroups, TempCaptures); - // [Then] There are 2 GroupCollections, where the second one contains 4 captures (one for each word) - Assert.AreEqual(2, Groups.Count(), 'Did not find 2 groups'); - Assert.AreEqual(4, Captures.Count(), 'Did not find 4 captures'); + // [Then] There are 2 GroupCollections, where the second one contains 4 TempCaptures (one for each word) + Assert.AreEqual(2, TempGroups.Count(), 'Did not find 2 TempGroups'); + Assert.AreEqual(4, TempCaptures.Count(), 'Did not find 4 TempCaptures'); - // [When] Running Matches with explicit capture, and extracting the captures in the first group of the first match. - RegexOptions.ExplicitCapture := true; - Regex.Match(Evaluator, Pattern, RegexOptions, Matches); - Regex.Groups(Matches, Groups); - Regex.Captures(Groups, Captures); + // [When] Running TempMatches with explicit capture, and extracting the TempCaptures in the first group of the first TempMatch. + TempRegexOptions.ExplicitCapture := true; + Regex.Match(Evaluator, Pattern, TempRegexOptions, TempMatches); + Regex.Groups(TempMatches, TempGroups); + Regex.Captures(TempGroups, TempCaptures); // [Then] There is 1 GroupCollections, that contains 1 capture (the entire sentence) - Assert.AreEqual(1, Groups.Count(), 'Did not find 1 Group'); - Assert.AreEqual(1, Captures.Count(), 'Did not find 1 Capture'); + Assert.AreEqual(1, TempGroups.Count(), 'Did not find 1 Group'); + Assert.AreEqual(1, TempCaptures.Count(), 'Did not find 1 Capture'); - // [When] Running Matches with explicit capture, and extracting the captures in the first group of the first match using the Regex pattern constructor. - RegexOptions.ExplicitCapture := true; - InstanceRegex.Regex(Pattern, RegexOptions); + // [When] Running TempMatches with explicit capture, and extracting the TempCaptures in the first group of the first TempMatch using the Regex pattern constructor. + TempRegexOptions.ExplicitCapture := true; + InstanceRegex.Regex(Pattern, TempRegexOptions); - InstanceRegex.Match(Evaluator, Matches); - InstanceRegex.Groups(Matches, Groups); - InstanceRegex.Captures(Groups, Captures); + InstanceRegex.Match(Evaluator, TempMatches); + InstanceRegex.Groups(TempMatches, TempGroups); + InstanceRegex.Captures(TempGroups, TempCaptures); // [Then] There is 1 GroupCollections, that contains 1 capture (the entire sentence) - Assert.AreEqual(1, Groups.Count(), 'Did not find 1 Group'); - Assert.AreEqual(1, Captures.Count(), 'Did not find 1 Capture'); + Assert.AreEqual(1, TempGroups.Count(), 'Did not find 1 Group'); + Assert.AreEqual(1, TempCaptures.Count(), 'Did not find 1 Capture'); end; [Test] procedure RightToLeftRegexOptionTest() var - RegexOptions: Record "Regex Options"; + TempRegexOptions: Record "Regex Options"; Pattern: Text; Evaluator: Text; IsMatched: Boolean; begin - // [Given] A Regex pattern that matches words beginning with 't', and a test string. + // [Given] A Regex pattern that TempMatches words beginning with 't', and a test string. Pattern := '\bt\w+\s'; Evaluator := 'testing right-left'; InstanceRegex.Regex(Pattern); - // [When] Matching without RegexOptions starting from index 8 + // [When] Matching without TempRegexOptions starting from index 8 IsMatched := Regex.IsMatch(Evaluator, Pattern, 8); - // [Then] Nothing will match + // [Then] Nothing will TempMatch Assert.IsFalse(IsMatched, 'Wrongly matched word'); - // [When] Matching without RegexOptions starting from index 8 + // [When] Matching without TempRegexOptions starting from index 8 IsMatched := InstanceRegex.IsMatch(Evaluator, 8); - // [Then] Nothing will match + // [Then] Nothing will TempMatch Assert.IsFalse(IsMatched, 'Wrongly matched word'); // [When] Matching with Right-To-Left RegexOption starting from index 8 - RegexOptions.RightToLeft := true; - InstanceRegex.Regex(Pattern, RegexOptions); + TempRegexOptions.RightToLeft := true; + InstanceRegex.Regex(Pattern, TempRegexOptions); - // [Then] It will match the word 'testing', since it in the substring we match against. - Assert.IsTrue(Regex.IsMatch(Evaluator, Pattern, 8, RegexOptions), 'Did not match word'); - Assert.IsTrue(InstanceRegex.IsMatch(Evaluator, 8), 'Did not match word'); + // [Then] It will TempMatch the word 'testing', since it in the substring we TempMatch against. + Assert.IsTrue(Regex.IsMatch(Evaluator, Pattern, 8, TempRegexOptions), 'Did not TempMatch word'); + Assert.IsTrue(InstanceRegex.IsMatch(Evaluator, 8), 'Did not TempMatch word'); end; local procedure GroupNameGroupNumberTestCheck(var ThisRegex: Codeunit Regex) @@ -413,7 +413,7 @@ codeunit 135057 RegexTests GroupName: Text; GroupNumber: Integer; begin - // [Then] It matches 5 groups (5 group names and 5 group numbers) + // [Then] It TempMatches 5 TempGroups (5 group names and 5 group numbers) ThisRegex.GetGroupNames(GroupNames); Assert.AreEqual(5, GroupNames.Count(), 'Not the right number of Groupnames'); @@ -424,43 +424,43 @@ codeunit 135057 RegexTests GroupNumber := ThisRegex.GroupNumberFromName('FirstWord'); // [Then] We get GroupNumber 3 - Assert.AreEqual(3, GroupNumber, 'Firstword Groupname did not match'); + Assert.AreEqual(3, GroupNumber, 'Firstword Groupname did not TempMatch'); // [And] The GroupName for Group 3 is FirstWord GroupName := ThisRegex.GroupNameFromNumber(GroupNumber); - Assert.AreEqual('FirstWord', GroupName, 'Firstword Groupname did not match'); + Assert.AreEqual('FirstWord', GroupName, 'Firstword Groupname did not TempMatch'); // [When] Getting GroupNumberFromName LastWord GroupNumber := ThisRegex.GroupNumberFromName('LastWord'); // [Then] We get GroupNumber 4 - Assert.AreEqual(4, GroupNumber, 'LastWord Groupname did not match'); + Assert.AreEqual(4, GroupNumber, 'LastWord Groupname did not TempMatch'); // [And] The GroupName for Group 4 is LastWord GroupName := ThisRegex.GroupNameFromNumber(GroupNumber); - Assert.AreEqual('LastWord', GroupName, 'LastWord Groupname did not match'); + Assert.AreEqual('LastWord', GroupName, 'LastWord Groupname did not TempMatch'); end; [Test] procedure GroupNameGroupNumberTest() var - Match: Record Matches; + TempMatch: Record Matches; Pattern: Text; Input: Text; begin - // [Given] A Regex pattern that matches all words but creates a Regex Group for the first and last word. + // [Given] A Regex pattern that TempMatches all words but creates a Regex Group for the first and last word. Pattern := '\b(?\w+)\s?((\w+)\s)*(?\w+)'; Input := 'The cow jumped over the moon.'; // [When] Matching with an arbitrary sentence - Regex.Match(Input, Pattern, Match); + Regex.Match(Input, Pattern, TempMatch); // [Then] Checks are performed GroupNameGroupNumberTestCheck(Regex); // [When] Matching with an arbitrary sentence InstanceRegex.Regex(Pattern); - InstanceRegex.Match(Input, Match); + InstanceRegex.Match(Input, TempMatch); // [Then] Checks are performed GroupNameGroupNumberTestCheck(InstanceRegex); @@ -469,76 +469,76 @@ codeunit 135057 RegexTests [Test] procedure MultipleOptionsTest() var - Match: Record Matches; - RegexOptions: Record "Regex Options"; + TempMatch: Record Matches; + TempRegexOptions: Record "Regex Options"; Pattern: Text; begin - // [Given] A pattern that matches two words that are the same + // [Given] A pattern that TempMatches two words that are the same Pattern := '\b P \S*'; InstanceRegex.Regex(Pattern); - // [Then] Regex does match anything because of the whitespaces in - Assert.IsFalse(Regex.IsMatch('Empower every person and organization...', Pattern), 'Wrongly found a match'); - Assert.IsFalse(InstanceRegex.IsMatch('Empower every person and organization...'), 'Wrongly found a match'); + // [Then] Regex does TempMatch anything because of the whitespaces in + Assert.IsFalse(Regex.IsMatch('Empower every person and organization...', Pattern), 'Wrongly found a TempMatch'); + Assert.IsFalse(InstanceRegex.IsMatch('Empower every person and organization...'), 'Wrongly found a TempMatch'); - Regex.Match('Empower every person and organization...', Pattern, Match); - Assert.AreEqual('', Match.ReadValue(), 'Wrongly found a match, despite whitespace in pattern'); + Regex.Match('Empower every person and organization...', Pattern, TempMatch); + Assert.AreEqual('', TempMatch.ReadValue(), 'Wrongly found a TempMatch, despite whitespace in pattern'); - InstanceRegex.Match('Empower every person and organization...', Match); - Assert.AreEqual('', Match.ReadValue(), 'Wrongly found a match, despite whitespace in pattern'); + InstanceRegex.Match('Empower every person and organization...', TempMatch); + Assert.AreEqual('', TempMatch.ReadValue(), 'Wrongly found a TempMatch, despite whitespace in pattern'); // [When] Regex is initialized with pattern and IgnorePatternWhiteSpace option - RegexOptions.IgnorePatternWhitespace := true; - RegexOptions.IgnoreCase := true; - RegexOptions.Compiled := true; - InstanceRegex.Regex(Pattern, RegexOptions); - - // [Then] Regex matches with "person" - Assert.IsTrue(Regex.IsMatch('Empower every person and organization...', Pattern, RegexOptions), 'Did not find a match'); - Regex.Match('Empower every person and organization...', Pattern, RegexOptions, Match); - Assert.AreEqual('person', Match.ReadValue(), 'Did not match the right word'); - - Assert.IsTrue(InstanceRegex.IsMatch('Empower every person and organization...'), 'Did not find a match'); - InstanceRegex.Match('Empower every person and organization...', Match); - Assert.AreEqual('person', Match.ReadValue(), 'Did not match the right word'); + TempRegexOptions.IgnorePatternWhitespace := true; + TempRegexOptions.IgnoreCase := true; + TempRegexOptions.Compiled := true; + InstanceRegex.Regex(Pattern, TempRegexOptions); + + // [Then] Regex TempMatches with "person" + Assert.IsTrue(Regex.IsMatch('Empower every person and organization...', Pattern, TempRegexOptions), 'Did not find a TempMatch'); + Regex.Match('Empower every person and organization...', Pattern, TempRegexOptions, TempMatch); + Assert.AreEqual('person', TempMatch.ReadValue(), 'Did not TempMatch the right word'); + + Assert.IsTrue(InstanceRegex.IsMatch('Empower every person and organization...'), 'Did not find a TempMatch'); + InstanceRegex.Match('Empower every person and organization...', TempMatch); + Assert.AreEqual('person', TempMatch.ReadValue(), 'Did not TempMatch the right word'); end; [Test] procedure MatchResultTest() var - Matches: Record Matches; + TempMatches: Record Matches; Pattern: Text; Replacement: Text; Input: Text; ResultingText: Text; begin - // [Given] A pattern that matches words within two double hyphens and an input string + // [Given] A pattern that TempMatches words within two double hyphens and an input string Pattern := '--(.+?)--'; Input := 'He said--decisively--that the time--whatever time it was--had come.'; // [When] Matching - Regex.Match(Input, Pattern, Matches); + Regex.Match(Input, Pattern, TempMatches); - // [Then] Then it matches the first word within double hyphens - Assert.AreEqual('--decisively--', Matches.ReadValue(), 'Did not match correctly'); + // [Then] Then it TempMatches the first word within double hyphens + Assert.AreEqual('--decisively--', TempMatches.ReadValue(), 'Did not TempMatch correctly'); // [When] Running MatchResult with replacement pattern Replacement := '($1)'; - ResultingText := Regex.MatchResult(Matches, Replacement); + ResultingText := Regex.MatchResult(TempMatches, Replacement); // [Then] The double hyphens were replaced with parentheses Assert.AreEqual('(decisively)', ResultingText, 'Did not replace correctly'); // [When] Matching using the Regex pattern constructor InstanceRegex.Regex(Pattern); - InstanceRegex.Match(Input, Matches); + InstanceRegex.Match(Input, TempMatches); - // [Then] Then it matches the first word within double hyphens - Assert.AreEqual('--decisively--', Matches.ReadValue(), 'Did not match correctly'); + // [Then] Then it TempMatches the first word within double hyphens + Assert.AreEqual('--decisively--', TempMatches.ReadValue(), 'Did not TempMatch correctly'); // [When] Running MatchResult with replacement pattern Replacement := '($1)'; - ResultingText := InstanceRegex.MatchResult(Matches, Replacement); + ResultingText := InstanceRegex.MatchResult(TempMatches, Replacement); // [Then] The double hyphens were replaced with parentheses Assert.AreEqual('(decisively)', ResultingText, 'Did not replace correctly'); @@ -547,8 +547,8 @@ codeunit 135057 RegexTests [Test] procedure RegexMinTimeoutTest() var - Matches: Record Matches; - RegexOptions: Record "Regex Options"; + TempMatches: Record Matches; + TempRegexOptions: Record "Regex Options"; Pattern: Text; Input: Text; begin @@ -556,31 +556,31 @@ codeunit 135057 RegexTests Pattern := '^((ab)*)+$'; Input := 'abababababababababababab a'; - // [When] Setting the match timeout to 100 - RegexOptions.MatchTimeoutInMs := 100; + // [When] Setting the TempMatch timeout to 100 + TempRegexOptions.MatchTimeoutInMs := 100; // [Then] We get an error, because the timeout should be minimum 1000 ms - asserterror Regex.Match(Input, Pattern, RegexOptions, Matches); + asserterror Regex.Match(Input, Pattern, TempRegexOptions, TempMatches); Assert.ExpectedError('The regular expression timeout should be at least 1000 ms'); - asserterror InstanceRegex.Regex(Pattern, RegexOptions); + asserterror InstanceRegex.Regex(Pattern, TempRegexOptions); Assert.ExpectedError('The regular expression timeout should be at least 1000 ms'); - // [When] Setting the match timeout to 10001 - RegexOptions.MatchTimeoutInMs := 10001; + // [When] Setting the TempMatch timeout to 10001 + TempRegexOptions.MatchTimeoutInMs := 10001; // [Then] We get an error, because the timeout should be maximum 10000 ms - asserterror Regex.Match(Input, Pattern, RegexOptions, Matches); + asserterror Regex.Match(Input, Pattern, TempRegexOptions, TempMatches); Assert.ExpectedError('The regular expression timeout should be at most 10000 ms'); - asserterror InstanceRegex.Regex(Pattern, RegexOptions); + asserterror InstanceRegex.Regex(Pattern, TempRegexOptions); Assert.ExpectedError('The regular expression timeout should be at most 10000 ms'); end; [Test] procedure RegexNotInstantiatedTest() var - Matches: Record Matches; + TempMatches: Record Matches; Input: Text; RegexIsNotInstanciatedErr: Label 'Regex is not Instantiated. Consider calling Regex() first or use an overload supporting a pattern.', Locked = true; begin @@ -590,7 +590,7 @@ codeunit 135057 RegexTests // [When] an instance procedure is called prior to calling the constructor Clear(InstanceRegex); - asserterror InstanceRegex.Match(Input, Matches); + asserterror InstanceRegex.Match(Input, TempMatches); // [Then] We get an error, because the DotNet class is not instanciated Assert.ExpectedError(RegexIsNotInstanciatedErr); diff --git a/src/System Application/Test/Security Groups/src/SecurityGroupsTest.Codeunit.al b/src/System Application/Test/Security Groups/src/SecurityGroupsTest.Codeunit.al index f0c2eff8f7..5dd1d69e5f 100644 --- a/src/System Application/Test/Security Groups/src/SecurityGroupsTest.Codeunit.al +++ b/src/System Application/Test/Security Groups/src/SecurityGroupsTest.Codeunit.al @@ -162,7 +162,7 @@ codeunit 135016 "Security Groups Test" [TransactionModel(TransactionModel::AutoRollback)] procedure TestGetGroups() var - SecurityGroupBuffer: Record "Security Group Buffer"; + TempSecurityGroupBuffer: Record "Security Group Buffer"; SecurityGroup: Codeunit "Security Group"; Sg1CodeTxt: Label 'SG1'; Sg2CodeTxt: Label 'SG2'; @@ -187,23 +187,23 @@ codeunit 135016 "Security Groups Test" SecurityGroup.Create(Sg3CodeTxt, Sg3IdTxt); // [THEN] GetGroups returns expected results - SecurityGroup.GetGroups(SecurityGroupBuffer); - Assert.RecordCount(SecurityGroupBuffer, 3); + SecurityGroup.GetGroups(TempSecurityGroupBuffer); + Assert.RecordCount(TempSecurityGroupBuffer, 3); - SecurityGroupBuffer.FindSet(); - Assert.AreEqual(Sg1CodeTxt, SecurityGroupBuffer.Code, ExpectedTheSameValueErr); - Assert.AreEqual(Sg1IdTxt, SecurityGroupBuffer."Group ID", ExpectedTheSameValueErr); - Assert.AreEqual(Sg1NameTxt, SecurityGroupBuffer."Group Name", ExpectedTheSameValueErr); + TempSecurityGroupBuffer.FindSet(); + Assert.AreEqual(Sg1CodeTxt, TempSecurityGroupBuffer.Code, ExpectedTheSameValueErr); + Assert.AreEqual(Sg1IdTxt, TempSecurityGroupBuffer."Group ID", ExpectedTheSameValueErr); + Assert.AreEqual(Sg1NameTxt, TempSecurityGroupBuffer."Group Name", ExpectedTheSameValueErr); - SecurityGroupBuffer.Next(); - Assert.AreEqual(Sg2CodeTxt, SecurityGroupBuffer.Code, ExpectedTheSameValueErr); - Assert.AreEqual(Sg2IdTxt, SecurityGroupBuffer."Group ID", ExpectedTheSameValueErr); - Assert.AreEqual(Sg2NameTxt, SecurityGroupBuffer."Group Name", ExpectedTheSameValueErr); + TempSecurityGroupBuffer.Next(); + Assert.AreEqual(Sg2CodeTxt, TempSecurityGroupBuffer.Code, ExpectedTheSameValueErr); + Assert.AreEqual(Sg2IdTxt, TempSecurityGroupBuffer."Group ID", ExpectedTheSameValueErr); + Assert.AreEqual(Sg2NameTxt, TempSecurityGroupBuffer."Group Name", ExpectedTheSameValueErr); - SecurityGroupBuffer.Next(); - Assert.AreEqual(Sg3CodeTxt, SecurityGroupBuffer.Code, ExpectedTheSameValueErr); - Assert.AreEqual(Sg3IdTxt, SecurityGroupBuffer."Group ID", ExpectedTheSameValueErr); - Assert.AreEqual(Sg3NameTxt, SecurityGroupBuffer."Group Name", ExpectedTheSameValueErr); + TempSecurityGroupBuffer.Next(); + Assert.AreEqual(Sg3CodeTxt, TempSecurityGroupBuffer.Code, ExpectedTheSameValueErr); + Assert.AreEqual(Sg3IdTxt, TempSecurityGroupBuffer."Group ID", ExpectedTheSameValueErr); + Assert.AreEqual(Sg3NameTxt, TempSecurityGroupBuffer."Group Name", ExpectedTheSameValueErr); TearDown(); end; @@ -213,7 +213,7 @@ codeunit 135016 "Security Groups Test" procedure TestGetGroupMembers() var User: Record User; - SecurityGroupMemberBuffer: Record "Security Group Member Buffer"; + TempSecurityGroupMemberBuffer: Record "Security Group Member Buffer"; SecurityGroup: Codeunit "Security Group"; NavUserAccountHelper: DotNet NavUserAccountHelper; GraphUser1: DotNet UserInfo; @@ -248,8 +248,8 @@ codeunit 135016 "Security Groups Test" // [GIVEN] No users are group members // [THEN] GetMembers returns an empty list - SecurityGroup.GetMembers(SecurityGroupMemberBuffer); - Assert.RecordIsEmpty(SecurityGroupMemberBuffer); + SecurityGroup.GetMembers(TempSecurityGroupMemberBuffer); + Assert.RecordIsEmpty(TempSecurityGroupMemberBuffer); // [WHEN] Users are added to groups in M365 @@ -281,23 +281,23 @@ codeunit 135016 "Security Groups Test" MockGraphQueryTestLibrary.AddGraphUserToGroup(GraphUser3, Sg2NameTxt, Sg2IdTxt); // [THEN] GetMembers returns expected results - SecurityGroup.GetMembers(SecurityGroupMemberBuffer); - Assert.RecordCount(SecurityGroupMemberBuffer, 3); + SecurityGroup.GetMembers(TempSecurityGroupMemberBuffer); + Assert.RecordCount(TempSecurityGroupMemberBuffer, 3); - SecurityGroupMemberBuffer.FindSet(); - Assert.AreEqual(Sg1CodeTxt, SecurityGroupMemberBuffer."Security Group Code", ExpectedTheSameValueErr); - Assert.AreEqual(User1SecId, SecurityGroupMemberBuffer."User Security ID", ExpectedTheSameValueErr); - Assert.AreEqual(Sg1NameTxt, SecurityGroupMemberBuffer."Security Group Name", ExpectedTheSameValueErr); + TempSecurityGroupMemberBuffer.FindSet(); + Assert.AreEqual(Sg1CodeTxt, TempSecurityGroupMemberBuffer."Security Group Code", ExpectedTheSameValueErr); + Assert.AreEqual(User1SecId, TempSecurityGroupMemberBuffer."User Security ID", ExpectedTheSameValueErr); + Assert.AreEqual(Sg1NameTxt, TempSecurityGroupMemberBuffer."Security Group Name", ExpectedTheSameValueErr); - SecurityGroupMemberBuffer.Next(); - Assert.AreEqual(Sg1CodeTxt, SecurityGroupMemberBuffer."Security Group Code", ExpectedTheSameValueErr); - Assert.AreEqual(User2SecId, SecurityGroupMemberBuffer."User Security ID", ExpectedTheSameValueErr); - Assert.AreEqual(Sg1NameTxt, SecurityGroupMemberBuffer."Security Group Name", ExpectedTheSameValueErr); + TempSecurityGroupMemberBuffer.Next(); + Assert.AreEqual(Sg1CodeTxt, TempSecurityGroupMemberBuffer."Security Group Code", ExpectedTheSameValueErr); + Assert.AreEqual(User2SecId, TempSecurityGroupMemberBuffer."User Security ID", ExpectedTheSameValueErr); + Assert.AreEqual(Sg1NameTxt, TempSecurityGroupMemberBuffer."Security Group Name", ExpectedTheSameValueErr); - SecurityGroupMemberBuffer.Next(); - Assert.AreEqual(Sg2CodeTxt, SecurityGroupMemberBuffer."Security Group Code", ExpectedTheSameValueErr); - Assert.AreEqual(User3SecId, SecurityGroupMemberBuffer."User Security ID", ExpectedTheSameValueErr); - Assert.AreEqual(Sg2NameTxt, SecurityGroupMemberBuffer."Security Group Name", ExpectedTheSameValueErr); + TempSecurityGroupMemberBuffer.Next(); + Assert.AreEqual(Sg2CodeTxt, TempSecurityGroupMemberBuffer."Security Group Code", ExpectedTheSameValueErr); + Assert.AreEqual(User3SecId, TempSecurityGroupMemberBuffer."User Security ID", ExpectedTheSameValueErr); + Assert.AreEqual(Sg2NameTxt, TempSecurityGroupMemberBuffer."Security Group Name", ExpectedTheSameValueErr); TearDown(); end; @@ -306,7 +306,7 @@ codeunit 135016 "Security Groups Test" [TransactionModel(TransactionModel::AutoRollback)] procedure TestCreateSecurityGroup() var - SecurityGroupBuffer: Record "Security Group Buffer"; + TempSecurityGroupBuffer: Record "Security Group Buffer"; SecurityGroupTemplateUser: Record User; SecurityGroupUserProperty: Record "User Property"; SecurityGroup: Codeunit "Security Group"; @@ -320,13 +320,13 @@ codeunit 135016 "Security Groups Test" SecurityGroup.Create(TestSecurityGroupCodeTxt, TestSecurityGroupIdTxt); // [THEN] Records in the appropriate tables are as expected - SecurityGroup.GetGroups(SecurityGroupBuffer); - Assert.RecordCount(SecurityGroupBuffer, 1); + SecurityGroup.GetGroups(TempSecurityGroupBuffer); + Assert.RecordCount(TempSecurityGroupBuffer, 1); - SecurityGroupTemplateUser.SetRange("User Security ID", SecurityGroupBuffer."Group User SID"); + SecurityGroupTemplateUser.SetRange("User Security ID", TempSecurityGroupBuffer."Group User SID"); Assert.RecordIsNotEmpty(SecurityGroupTemplateUser); - SecurityGroupUserProperty.SetRange("User Security ID", SecurityGroupBuffer."Group User SID"); + SecurityGroupUserProperty.SetRange("User Security ID", TempSecurityGroupBuffer."Group User SID"); Assert.RecordIsNotEmpty(SecurityGroupUserProperty); SecurityGroupUserProperty.FindFirst(); Assert.AreEqual(TestSecurityGroupIdTxt, SecurityGroupUserProperty."Authentication Object ID", 'Expected the user property to contain the AAD group ID.'); @@ -338,7 +338,7 @@ codeunit 135016 "Security Groups Test" [TransactionModel(TransactionModel::AutoRollback)] procedure TestGetGroupUserSecurityId() var - SecurityGroupBuffer: Record "Security Group Buffer"; + TempSecurityGroupBuffer: Record "Security Group Buffer"; SecurityGroup: Codeunit "Security Group"; SecurityGroupUserTemplateId: Guid; begin @@ -354,8 +354,8 @@ codeunit 135016 "Security Groups Test" SecurityGroupUserTemplateId := SecurityGroup.GetGroupUserSecurityId(TestSecurityGroupCodeTxt); // [THEN] The user security ID of the template user for the security group is as expected - SecurityGroup.GetGroups(SecurityGroupBuffer); - Assert.AreEqual(SecurityGroupBuffer."Group User SID", SecurityGroupUserTemplateId, 'Unexpected user security ID for the AAD group user.'); + SecurityGroup.GetGroups(TempSecurityGroupBuffer); + Assert.AreEqual(TempSecurityGroupBuffer."Group User SID", SecurityGroupUserTemplateId, 'Unexpected user security ID for the AAD group user.'); TearDown(); end; @@ -419,7 +419,7 @@ codeunit 135016 "Security Groups Test" [TransactionModel(TransactionModel::AutoRollback)] procedure TestDeleteSecurityGroup() var - SecurityGroupBuffer: Record "Security Group Buffer"; + TempSecurityGroupBuffer: Record "Security Group Buffer"; SecurityGroupUser: Record User; SecurityGroupUserProperty: Record "User Property"; AccessControl: Record "Access Control"; @@ -444,8 +444,8 @@ codeunit 135016 "Security Groups Test" SecurityGroup.Delete(TestSecurityGroupCodeTxt); // [THEN] There are no traces of the security group in the relevant tables - SecurityGroup.GetGroups(SecurityGroupBuffer); - Assert.RecordIsEmpty(SecurityGroupBuffer); + SecurityGroup.GetGroups(TempSecurityGroupBuffer); + Assert.RecordIsEmpty(TempSecurityGroupBuffer); Assert.RecordIsEmpty(SecurityGroupUser); Assert.RecordIsEmpty(SecurityGroupUserProperty); @@ -460,7 +460,7 @@ codeunit 135016 "Security Groups Test" procedure TestCopy() var AccessControl: Record "Access Control"; - SecurityGroupBuffer: Record "Security Group Buffer"; + TempSecurityGroupBuffer: Record "Security Group Buffer"; SecurityGroup: Codeunit "Security Group"; CopySecurityGroup: Page "Copy Security Group"; DestinationSgIdTxt: Label 'AAD SG2 ID'; @@ -479,21 +479,21 @@ codeunit 135016 "Security Groups Test" SecurityGroup.AddPermissionSet(TestSecurityGroupCodeTxt, TestRoleIdTxt, TestCompanyNameTxt, Scope::Tenant, NullAppId); // [WHEN] The source security group is copied - SecurityGroup.GetGroups(SecurityGroupBuffer); - CopySecurityGroup.SetSourceGroupCode(SecurityGroupBuffer.Code); + SecurityGroup.GetGroups(TempSecurityGroupBuffer); + CopySecurityGroup.SetSourceGroupCode(TempSecurityGroupBuffer.Code); CopySecurityGroup.RunModal(); // Set the required values on the request page: new security group code and name inside CopySecurityGroupHandler // [THEN] The source group has been copied successfully - SecurityGroup.GetGroups(SecurityGroupBuffer); - Assert.RecordCount(SecurityGroupBuffer, 2); + SecurityGroup.GetGroups(TempSecurityGroupBuffer); + Assert.RecordCount(TempSecurityGroupBuffer, 2); - SecurityGroupBuffer.Get('SG2'); - Assert.AreEqual(DestinationSgIdTxt, SecurityGroupBuffer."Group ID", ExpectedTheSameValueErr); - Assert.AreEqual(DestinationSgNameTxt, SecurityGroupBuffer."Group Name", ExpectedTheSameValueErr); - Assert.AreNotEqual(SecurityGroup.GetGroupUserSecurityId(TestSecurityGroupCodeTxt), SecurityGroupBuffer."Group User SID", 'Expected a new group user security ID for the copied group.'); + TempSecurityGroupBuffer.Get('SG2'); + Assert.AreEqual(DestinationSgIdTxt, TempSecurityGroupBuffer."Group ID", ExpectedTheSameValueErr); + Assert.AreEqual(DestinationSgNameTxt, TempSecurityGroupBuffer."Group Name", ExpectedTheSameValueErr); + Assert.AreNotEqual(SecurityGroup.GetGroupUserSecurityId(TestSecurityGroupCodeTxt), TempSecurityGroupBuffer."Group User SID", 'Expected a new group user security ID for the copied group.'); - AccessControl.SetRange("User Security ID", SecurityGroupBuffer."Group User SID"); + AccessControl.SetRange("User Security ID", TempSecurityGroupBuffer."Group User SID"); Assert.RecordCount(AccessControl, 1); AccessControl.FindFirst(); Assert.AreEqual(TestRoleIdTxt, AccessControl."Role ID", ExpectedTheSameValueErr); @@ -540,7 +540,7 @@ codeunit 135016 "Security Groups Test" [TransactionModel(TransactionModel::AutoRollback)] procedure TestCreateWithOrphanedSecurityGroups() var - SecurityGroupBuffer: Record "Security Group Buffer"; + TempSecurityGroupBuffer: Record "Security Group Buffer"; SecurityGroupUser: Record User; SecurityGroup: Codeunit "Security Group"; NavUserAccountHelper: DotNet NavUserAccountHelper; @@ -563,8 +563,8 @@ codeunit 135016 "Security Groups Test" SecurityGroup.Create(TestSecurityGroupCodeTxt, TestSecurityGroupIdTxt); // [THEN] There is one properly defined security group in the system - SecurityGroup.GetGroups(SecurityGroupBuffer); - Assert.RecordCount(SecurityGroupBuffer, 1); + SecurityGroup.GetGroups(TempSecurityGroupBuffer); + Assert.RecordCount(TempSecurityGroupBuffer, 1); TearDown(); end; @@ -637,7 +637,7 @@ codeunit 135016 "Security Groups Test" var TenantPermissionSet: Record "Tenant Permission Set"; AccessControl: Record "Access Control"; - SecurityGroupBuffer: Record "Security Group Buffer"; + TempSecurityGroupBuffer: Record "Security Group Buffer"; SecurityGroup: Codeunit "Security Group"; TempBlob: Codeunit "Temp Blob"; OutStr: OutStream; @@ -681,23 +681,23 @@ codeunit 135016 "Security Groups Test" // [THEN] The imported security groups are as expected // Verify groups have been created - SecurityGroup.GetGroups(SecurityGroupBuffer); - Assert.RecordCount(SecurityGroupBuffer, 3); - - SecurityGroupBuffer.FindSet(); - Assert.AreEqual(Sg1CodeTxt, SecurityGroupBuffer.Code, ExpectedTheSameValueErr); - Assert.AreEqual(Sg1IdTxt, SecurityGroupBuffer."Group ID", ExpectedTheSameValueErr); - Assert.AreEqual(Sg1NameTxt, SecurityGroupBuffer."Group Name", ExpectedTheSameValueErr); - - SecurityGroupBuffer.Next(); - Assert.AreEqual(Sg2CodeTxt, SecurityGroupBuffer.Code, ExpectedTheSameValueErr); - Assert.AreEqual(Sg2IdTxt, SecurityGroupBuffer."Group ID", ExpectedTheSameValueErr); - Assert.AreEqual(Sg2NameTxt, SecurityGroupBuffer."Group Name", ExpectedTheSameValueErr); - - SecurityGroupBuffer.Next(); - Assert.AreEqual(Sg3CodeTxt, SecurityGroupBuffer.Code, ExpectedTheSameValueErr); - Assert.AreEqual(Sg3IdTxt, SecurityGroupBuffer."Group ID", ExpectedTheSameValueErr); - Assert.AreEqual(Sg3NameTxt, SecurityGroupBuffer."Group Name", ExpectedTheSameValueErr); + SecurityGroup.GetGroups(TempSecurityGroupBuffer); + Assert.RecordCount(TempSecurityGroupBuffer, 3); + + TempSecurityGroupBuffer.FindSet(); + Assert.AreEqual(Sg1CodeTxt, TempSecurityGroupBuffer.Code, ExpectedTheSameValueErr); + Assert.AreEqual(Sg1IdTxt, TempSecurityGroupBuffer."Group ID", ExpectedTheSameValueErr); + Assert.AreEqual(Sg1NameTxt, TempSecurityGroupBuffer."Group Name", ExpectedTheSameValueErr); + + TempSecurityGroupBuffer.Next(); + Assert.AreEqual(Sg2CodeTxt, TempSecurityGroupBuffer.Code, ExpectedTheSameValueErr); + Assert.AreEqual(Sg2IdTxt, TempSecurityGroupBuffer."Group ID", ExpectedTheSameValueErr); + Assert.AreEqual(Sg2NameTxt, TempSecurityGroupBuffer."Group Name", ExpectedTheSameValueErr); + + TempSecurityGroupBuffer.Next(); + Assert.AreEqual(Sg3CodeTxt, TempSecurityGroupBuffer.Code, ExpectedTheSameValueErr); + Assert.AreEqual(Sg3IdTxt, TempSecurityGroupBuffer."Group ID", ExpectedTheSameValueErr); + Assert.AreEqual(Sg3NameTxt, TempSecurityGroupBuffer."Group Name", ExpectedTheSameValueErr); // Verify permission sets have been added AccessControl.SetRange("User Security ID", SecurityGroup.GetGroupUserSecurityId(Sg1CodeTxt)); diff --git a/src/System Application/Test/Security Groups/src/SecurityGroupsUpgradeTest.Codeunit.al b/src/System Application/Test/Security Groups/src/SecurityGroupsUpgradeTest.Codeunit.al index 1a2823318d..53fe02478d 100644 --- a/src/System Application/Test/Security Groups/src/SecurityGroupsUpgradeTest.Codeunit.al +++ b/src/System Application/Test/Security Groups/src/SecurityGroupsUpgradeTest.Codeunit.al @@ -22,7 +22,7 @@ codeunit 135017 "Security Groups Upgrade Test" [TransactionModel(TransactionModel::AutoRollback)] procedure TestAddExistingSecurityGroups() var - SecurityGroupBuffer: Record "Security Group Buffer"; + TempSecurityGroupBuffer: Record "Security Group Buffer"; SecurityGroup: Codeunit "Security Group"; SecurityGroupsTestLibrary: Codeunit "Security Groups Test Library"; begin @@ -35,17 +35,17 @@ codeunit 135017 "Security Groups Upgrade Test" SecurityGroupsTestLibrary.RunUpgrade(); // Security Groups have been created as expected - SecurityGroup.GetGroups(SecurityGroupBuffer); - Assert.RecordCount(SecurityGroupBuffer, 3); + SecurityGroup.GetGroups(TempSecurityGroupBuffer); + Assert.RecordCount(TempSecurityGroupBuffer, 3); - SecurityGroupBuffer.FindSet(); - Assert.AreEqual(SecurityGroupBuffer.Code, 'SECURITY GROUP', UnexpectedGroupCodeErr); + TempSecurityGroupBuffer.FindSet(); + Assert.AreEqual(TempSecurityGroupBuffer.Code, 'SECURITY GROUP', UnexpectedGroupCodeErr); - SecurityGroupBuffer.Next(); - Assert.AreEqual(SecurityGroupBuffer.Code, 'SECURITY GROUP_1', UnexpectedGroupCodeErr); + TempSecurityGroupBuffer.Next(); + Assert.AreEqual(TempSecurityGroupBuffer.Code, 'SECURITY GROUP_1', UnexpectedGroupCodeErr); - SecurityGroupBuffer.Next(); - Assert.AreEqual(SecurityGroupBuffer.Code, 'SECURITY GROUP_2', UnexpectedGroupCodeErr); + TempSecurityGroupBuffer.Next(); + Assert.AreEqual(TempSecurityGroupBuffer.Code, 'SECURITY GROUP_2', UnexpectedGroupCodeErr); end; local procedure SetupWindowsGroupUsers() diff --git a/src/System Application/Test/Translation/src/TranslationTests.Codeunit.al b/src/System Application/Test/Translation/src/TranslationTests.Codeunit.al index 33395ef022..929bd61362 100644 --- a/src/System Application/Test/Translation/src/TranslationTests.Codeunit.al +++ b/src/System Application/Test/Translation/src/TranslationTests.Codeunit.al @@ -485,7 +485,7 @@ codeunit 137121 "Translation Tests" procedure GetTranslationsForOneFieldFromRecord() var TranslationTestTable: Record "Translation Test Table"; - TranslationBuffer: Record "Translation Buffer"; + TempTranslationBuffer: Record "Translation Buffer"; begin // [SCENARIO] Translation must be retrieved correctly for one field @@ -500,27 +500,27 @@ codeunit 137121 "Translation Tests" // [WHEN] Translations are retrieved for a specific field Assert.IsTrue( - Translation.GetTranslations(TranslationTestTable, TranslationTestTable.FieldNo(TextField), TranslationBuffer), + Translation.GetTranslations(TranslationTestTable, TranslationTestTable.FieldNo(TextField), TempTranslationBuffer), 'GetTranslations should return true when translations exist'); // [THEN] Verify that only translations for the requested field are returned - Assert.AreEqual(2, TranslationBuffer.Count(), 'Should have 2 translations for the TextField'); + Assert.AreEqual(2, TempTranslationBuffer.Count(), 'Should have 2 translations for the TextField'); // [THEN] Verify the translation values - TranslationBuffer.SetRange("Language ID", GetEnglishLanguageId()); - Assert.IsTrue(TranslationBuffer.FindFirst(), 'English translation should exist'); - Assert.AreEqual(Text1Txt, TranslationBuffer.Value, 'Incorrect English translation value'); - Assert.AreEqual(TranslationTestTable.FieldNo(TextField), TranslationBuffer."Field ID", 'Incorrect Field ID'); - Assert.AreEqual(TranslationTestTable.SystemId, TranslationBuffer."System ID", 'Incorrect System ID'); + TempTranslationBuffer.SetRange("Language ID", GetEnglishLanguageId()); + Assert.IsTrue(TempTranslationBuffer.FindFirst(), 'English translation should exist'); + Assert.AreEqual(Text1Txt, TempTranslationBuffer.Value, 'Incorrect English translation value'); + Assert.AreEqual(TranslationTestTable.FieldNo(TextField), TempTranslationBuffer."Field ID", 'Incorrect Field ID'); + Assert.AreEqual(TranslationTestTable.SystemId, TempTranslationBuffer."System ID", 'Incorrect System ID'); - TranslationBuffer.SetRange("Language ID", GetDanishLanguageId()); - Assert.IsTrue(TranslationBuffer.FindFirst(), 'Danish translation should exist'); - Assert.AreEqual(Text2Txt, TranslationBuffer.Value, 'Incorrect Danish translation value'); + TempTranslationBuffer.SetRange("Language ID", GetDanishLanguageId()); + Assert.IsTrue(TempTranslationBuffer.FindFirst(), 'Danish translation should exist'); + Assert.AreEqual(Text2Txt, TempTranslationBuffer.Value, 'Incorrect Danish translation value'); // [THEN] Verify no translations for SecondTextField are included - TranslationBuffer.SetRange("Language ID"); - TranslationBuffer.SetRange("Field ID", TranslationTestTable.FieldNo(SecondTextField)); - Assert.IsTrue(TranslationBuffer.IsEmpty(), 'No translations for SecondTextField should be returned'); + TempTranslationBuffer.SetRange("Language ID"); + TempTranslationBuffer.SetRange("Field ID", TranslationTestTable.FieldNo(SecondTextField)); + Assert.IsTrue(TempTranslationBuffer.IsEmpty(), 'No translations for SecondTextField should be returned'); end; [Test] @@ -528,7 +528,7 @@ codeunit 137121 "Translation Tests" procedure GetTranslationsForAllFieldsFromRecord() var TranslationTestTable: Record "Translation Test Table"; - TranslationBuffer: Record "Translation Buffer"; + TempTranslationBuffer: Record "Translation Buffer"; begin // [SCENARIO] Translation must be retrieved correctly for all fields when FieldId is 0 @@ -544,36 +544,36 @@ codeunit 137121 "Translation Tests" // [WHEN] Translations are retrieved for all fields (FieldId = 0) Assert.IsTrue( - Translation.GetTranslations(TranslationTestTable, 0, TranslationBuffer), + Translation.GetTranslations(TranslationTestTable, 0, TempTranslationBuffer), 'GetTranslations should return true when translations exist'); // [THEN] Verify that translations for all fields are returned - Assert.AreEqual(4, TranslationBuffer.Count(), 'Should have 4 translations total (2 fields x 2 languages each)'); + Assert.AreEqual(4, TempTranslationBuffer.Count(), 'Should have 4 translations total (2 fields x 2 languages each)'); // [THEN] Verify TextField translations - TranslationBuffer.SetRange("Field ID", TranslationTestTable.FieldNo(TextField)); - Assert.AreEqual(2, TranslationBuffer.Count(), 'Should have 2 translations for TextField'); + TempTranslationBuffer.SetRange("Field ID", TranslationTestTable.FieldNo(TextField)); + Assert.AreEqual(2, TempTranslationBuffer.Count(), 'Should have 2 translations for TextField'); - TranslationBuffer.SetRange("Language ID", GetEnglishLanguageId()); - Assert.IsTrue(TranslationBuffer.FindFirst(), 'English translation for TextField should exist'); - Assert.AreEqual(Text1Txt, TranslationBuffer.Value, 'Incorrect English translation for TextField'); + TempTranslationBuffer.SetRange("Language ID", GetEnglishLanguageId()); + Assert.IsTrue(TempTranslationBuffer.FindFirst(), 'English translation for TextField should exist'); + Assert.AreEqual(Text1Txt, TempTranslationBuffer.Value, 'Incorrect English translation for TextField'); - TranslationBuffer.SetRange("Language ID", GetDanishLanguageId()); - Assert.IsTrue(TranslationBuffer.FindFirst(), 'Danish translation for TextField should exist'); - Assert.AreEqual(Text2Txt, TranslationBuffer.Value, 'Incorrect Danish translation for TextField'); + TempTranslationBuffer.SetRange("Language ID", GetDanishLanguageId()); + Assert.IsTrue(TempTranslationBuffer.FindFirst(), 'Danish translation for TextField should exist'); + Assert.AreEqual(Text2Txt, TempTranslationBuffer.Value, 'Incorrect Danish translation for TextField'); // [THEN] Verify SecondTextField translations - TranslationBuffer.SetRange("Language ID"); - TranslationBuffer.SetRange("Field ID", TranslationTestTable.FieldNo(SecondTextField)); - Assert.AreEqual(2, TranslationBuffer.Count(), 'Should have 2 translations for SecondTextField'); + TempTranslationBuffer.SetRange("Language ID"); + TempTranslationBuffer.SetRange("Field ID", TranslationTestTable.FieldNo(SecondTextField)); + Assert.AreEqual(2, TempTranslationBuffer.Count(), 'Should have 2 translations for SecondTextField'); - TranslationBuffer.SetRange("Language ID", GetEnglishLanguageId()); - Assert.IsTrue(TranslationBuffer.FindFirst(), 'English translation for SecondTextField should exist'); - Assert.AreEqual(Text3Txt, TranslationBuffer.Value, 'Incorrect English translation for SecondTextField'); + TempTranslationBuffer.SetRange("Language ID", GetEnglishLanguageId()); + Assert.IsTrue(TempTranslationBuffer.FindFirst(), 'English translation for SecondTextField should exist'); + Assert.AreEqual(Text3Txt, TempTranslationBuffer.Value, 'Incorrect English translation for SecondTextField'); - TranslationBuffer.SetRange("Language ID", GetFrenchLanguageId()); - Assert.IsTrue(TranslationBuffer.FindFirst(), 'French translation for SecondTextField should exist'); - Assert.AreEqual(Text4Txt, TranslationBuffer.Value, 'Incorrect French translation for SecondTextField'); + TempTranslationBuffer.SetRange("Language ID", GetFrenchLanguageId()); + Assert.IsTrue(TempTranslationBuffer.FindFirst(), 'French translation for SecondTextField should exist'); + Assert.AreEqual(Text4Txt, TempTranslationBuffer.Value, 'Incorrect French translation for SecondTextField'); end; [Test] @@ -581,7 +581,7 @@ codeunit 137121 "Translation Tests" procedure GetTranslationsNoTranslationsExist() var TranslationTestTable: Record "Translation Test Table"; - TranslationBuffer: Record "Translation Buffer"; + TempTranslationBuffer: Record "Translation Buffer"; begin // [SCENARIO] GetTranslations returns false when no translations exist @@ -594,11 +594,11 @@ codeunit 137121 "Translation Tests" // [WHEN] Translations are retrieved // [THEN] GetTranslations should return false Assert.IsFalse( - Translation.GetTranslations(TranslationTestTable, TranslationTestTable.FieldNo(TextField), TranslationBuffer), + Translation.GetTranslations(TranslationTestTable, TranslationTestTable.FieldNo(TextField), TempTranslationBuffer), 'GetTranslations should return false when no translations exist'); // [THEN] Buffer should be empty - Assert.IsTrue(TranslationBuffer.IsEmpty(), 'Translation buffer should be empty'); + Assert.IsTrue(TempTranslationBuffer.IsEmpty(), 'Translation buffer should be empty'); end; [Test] @@ -606,7 +606,7 @@ codeunit 137121 "Translation Tests" procedure GetTranslationsWithRecordRef() var TranslationTestTable: Record "Translation Test Table"; - TranslationBuffer: Record "Translation Buffer"; + TempTranslationBuffer: Record "Translation Buffer"; RecRef: RecordRef; begin // [SCENARIO] GetTranslations works correctly with RecordRef variant @@ -624,15 +624,15 @@ codeunit 137121 "Translation Tests" // [WHEN] Translations are retrieved using RecordRef Assert.IsTrue( - Translation.GetTranslations(RecRef, TranslationTestTable.FieldNo(TextField), TranslationBuffer), + Translation.GetTranslations(RecRef, TranslationTestTable.FieldNo(TextField), TempTranslationBuffer), 'GetTranslations should work with RecordRef'); // [THEN] Verify translations are returned correctly - Assert.AreEqual(2, TranslationBuffer.Count(), 'Should have 2 translations'); + Assert.AreEqual(2, TempTranslationBuffer.Count(), 'Should have 2 translations'); - TranslationBuffer.SetRange("Language ID", GetEnglishLanguageId()); - Assert.IsTrue(TranslationBuffer.FindFirst(), 'English translation should exist'); - Assert.AreEqual(Text1Txt, TranslationBuffer.Value, 'Incorrect English translation value'); + TempTranslationBuffer.SetRange("Language ID", GetEnglishLanguageId()); + Assert.IsTrue(TempTranslationBuffer.FindFirst(), 'English translation should exist'); + Assert.AreEqual(Text1Txt, TempTranslationBuffer.Value, 'Incorrect English translation value'); end; [Test] @@ -640,7 +640,7 @@ codeunit 137121 "Translation Tests" procedure GetTranslationsBufferContainsCorrectMetadata() var TranslationTestTable: Record "Translation Test Table"; - TranslationBuffer: Record "Translation Buffer"; + TempTranslationBuffer: Record "Translation Buffer"; begin // [SCENARIO] Translation Buffer contains correct metadata fields @@ -652,15 +652,15 @@ codeunit 137121 "Translation Tests" Translation.Set(TranslationTestTable, TranslationTestTable.FieldNo(TextField), GetDanishLanguageId(), Text2Txt); // [WHEN] Translations are retrieved - Translation.GetTranslations(TranslationTestTable, TranslationTestTable.FieldNo(TextField), TranslationBuffer); + Translation.GetTranslations(TranslationTestTable, TranslationTestTable.FieldNo(TextField), TempTranslationBuffer); // [THEN] Verify all metadata fields are populated correctly - Assert.IsTrue(TranslationBuffer.FindFirst(), 'Translation should exist'); - Assert.AreEqual(GetDanishLanguageId(), TranslationBuffer."Language ID", 'Incorrect Language ID'); - Assert.AreEqual(TranslationTestTable.SystemId, TranslationBuffer."System ID", 'Incorrect System ID'); - Assert.AreEqual(Database::"Translation Test Table", TranslationBuffer."Table ID", 'Incorrect Table ID'); - Assert.AreEqual(TranslationTestTable.FieldNo(TextField), TranslationBuffer."Field ID", 'Incorrect Field ID'); - Assert.AreEqual(Text2Txt, TranslationBuffer.Value, 'Incorrect translation value'); + Assert.IsTrue(TempTranslationBuffer.FindFirst(), 'Translation should exist'); + Assert.AreEqual(GetDanishLanguageId(), TempTranslationBuffer."Language ID", 'Incorrect Language ID'); + Assert.AreEqual(TranslationTestTable.SystemId, TempTranslationBuffer."System ID", 'Incorrect System ID'); + Assert.AreEqual(Database::"Translation Test Table", TempTranslationBuffer."Table ID", 'Incorrect Table ID'); + Assert.AreEqual(TranslationTestTable.FieldNo(TextField), TempTranslationBuffer."Field ID", 'Incorrect Field ID'); + Assert.AreEqual(Text2Txt, TempTranslationBuffer.Value, 'Incorrect translation value'); end; local procedure Initialize() diff --git a/src/System Application/Test/User Settings/src/UserSettingsTests.Codeunit.al b/src/System Application/Test/User Settings/src/UserSettingsTests.Codeunit.al index 8415907f24..c410681b61 100644 --- a/src/System Application/Test/User Settings/src/UserSettingsTests.Codeunit.al +++ b/src/System Application/Test/User Settings/src/UserSettingsTests.Codeunit.al @@ -161,7 +161,7 @@ codeunit 132905 "User Settings Tests" [TransactionModel(TransactionModel::AutoRollback)] procedure TestDefaultSettings() var - UserSettingsRec: Record "User Settings"; + TempUserSettingsRec: Record "User Settings"; TenantProfileSettings: Record "Tenant Profile Setting"; LibraryUserSettings: Codeunit "Library - User Settings"; UserSettings: Codeunit "User Settings"; @@ -177,14 +177,14 @@ codeunit 132905 "User Settings Tests" PermissionsMock.Set('User Settings View'); // [WHEN] GetUSerSettings is called - UserSettings.GetUserSettings(UserSecurityId(), UserSettingsRec); + UserSettings.GetUserSettings(UserSecurityId(), TempUserSettingsRec); // [THEN] The default user Settings are populated - Assert.AreEqual(UserSecurityId(), UserSettingsRec."User Security ID", 'The current user''s id was expected.'); - Assert.IsTrue(UserSettingsRec.Initialized, 'The settings should have been initialized.'); - Assert.AreEqual(CompanyName(), UserSettingsRec.Company, 'Company should match CompanyName ().'); - Assert.AreEqual(WorkDate(), UserSettingsRec."Work Date", 'A different work date was expected.'); - Assert.IsTrue(UserSettingsRec."Teaching Tips", 'Teaching tips should be enabled.'); + Assert.AreEqual(UserSecurityId(), TempUserSettingsRec."User Security ID", 'The current user''s id was expected.'); + Assert.IsTrue(TempUserSettingsRec.Initialized, 'The settings should have been initialized.'); + Assert.AreEqual(CompanyName(), TempUserSettingsRec.Company, 'Company should match CompanyName ().'); + Assert.AreEqual(WorkDate(), TempUserSettingsRec."Work Date", 'A different work date was expected.'); + Assert.IsTrue(TempUserSettingsRec."Teaching Tips", 'Teaching tips should be enabled.'); end; [Test] @@ -192,7 +192,7 @@ codeunit 132905 "User Settings Tests" procedure TestDefaultProfileSettings() var TenantProfileSetting: Record "Tenant Profile Setting"; - UserSettingsRec: Record "User Settings"; + TempUserSettingsRec: Record "User Settings"; LibraryUserSettings: Codeunit "Library - User Settings"; UserSettings: Codeunit "User Settings"; AppId: Guid; @@ -211,41 +211,41 @@ codeunit 132905 "User Settings Tests" PermissionsMock.Set('User Settings View'); // [WHEN] GetUSerSettings is called - UserSettings.GetUserSettings(UserSecurityId(), UserSettingsRec); + UserSettings.GetUserSettings(UserSecurityId(), TempUserSettingsRec); // [THEN] The blank profile shows - Assert.AreEqual('TESTROLECENTER', UserSettingsRec."Profile ID", 'A different profile was expected'); + Assert.AreEqual('TESTROLECENTER', TempUserSettingsRec."Profile ID", 'A different profile was expected'); AppId := '23de40a6-dfe8-4f80-80db-d70f83ce8caf'; - Assert.AreEqual(AppId, UserSettingsRec."App ID", 'A different app id was expected'); - Assert.AreEqual(UserSettingsRec.Scope::Tenant, UserSettingsRec.Scope, 'A different profile was expected'); + Assert.AreEqual(AppId, TempUserSettingsRec."App ID", 'A different app id was expected'); + Assert.AreEqual(TempUserSettingsRec.Scope::Tenant, TempUserSettingsRec.Scope, 'A different profile was expected'); end; [Test] procedure TestEnableTeachingTips() var - UserSettingsRec: Record "User Settings"; + TempUserSettingsRec: Record "User Settings"; UserSettings: Codeunit "User Settings"; begin // exercise UserSettings.EnableTeachingTips(UserSecurityId()); // validate - UserSettings.GetUserSettings(UserSecurityId(), UserSettingsRec); - Assert.IsTrue(UserSettingsRec."Teaching Tips", 'Teaching Tips should have been enabled.'); + UserSettings.GetUserSettings(UserSecurityId(), TempUserSettingsRec); + Assert.IsTrue(TempUserSettingsRec."Teaching Tips", 'Teaching Tips should have been enabled.'); end; [Test] procedure TestDisableTeachingTips() var - UserSettingsRec: Record "User Settings"; + TempUserSettingsRec: Record "User Settings"; UserSettings: Codeunit "User Settings"; begin // exercise UserSettings.DisableTeachingTips(UserSecurityId()); // validate - UserSettings.GetUserSettings(UserSecurityId(), UserSettingsRec); - Assert.IsFalse(UserSettingsRec."Teaching Tips", 'Teaching Tips should have been disabled.'); + UserSettings.GetUserSettings(UserSecurityId(), TempUserSettingsRec); + Assert.IsFalse(TempUserSettingsRec."Teaching Tips", 'Teaching Tips should have been disabled.'); end; [Test] diff --git a/src/Tools/AI Test Toolkit/src/Limits/CopilotCredits/AITEvalMonthlyCopilotCred.Page.al b/src/Tools/AI Test Toolkit/src/Limits/CopilotCredits/AITEvalMonthlyCopilotCred.Page.al index 82a9faa937..c594e9d6a9 100644 --- a/src/Tools/AI Test Toolkit/src/Limits/CopilotCredits/AITEvalMonthlyCopilotCred.Page.al +++ b/src/Tools/AI Test Toolkit/src/Limits/CopilotCredits/AITEvalMonthlyCopilotCred.Page.al @@ -201,7 +201,7 @@ page 149048 "AIT Eval Monthly Copilot Cred." local procedure LoadBufferData() var AITTestSuite: Record "AIT Test Suite"; - AIEvalSuiteUsageBufferTemp: Record "AIT Eval Suite Usage Buffer"; + TempAIEvalSuiteUsageBuffer: Record "AIT Eval Suite Usage Buffer"; AgentTestContextImpl: Codeunit "Agent Test Context Impl."; SortOrder: Integer; begin @@ -214,25 +214,25 @@ page 149048 "AIT Eval Monthly Copilot Cred." if AITTestSuite.FindSet() then repeat SortOrder += 1; - AIEvalSuiteUsageBufferTemp.Index := SortOrder; - AIEvalSuiteUsageBufferTemp."Suite Code" := AITTestSuite.Code; - AIEvalSuiteUsageBufferTemp."Suite Description" := AITTestSuite.Description; - AIEvalSuiteUsageBufferTemp.Consumed := AgentTestContextImpl.GetCopilotCreditsForPeriod(AITTestSuite.Code, AITEvalMonthlyCopilotCreditLimitRecord.GetPeriodStartDate()); - AIEvalSuiteUsageBufferTemp.Insert(); - LoadedDataCopilotCreditsConsumed += AIEvalSuiteUsageBufferTemp.Consumed; + TempAIEvalSuiteUsageBuffer.Index := SortOrder; + TempAIEvalSuiteUsageBuffer."Suite Code" := AITTestSuite.Code; + TempAIEvalSuiteUsageBuffer."Suite Description" := AITTestSuite.Description; + TempAIEvalSuiteUsageBuffer.Consumed := AgentTestContextImpl.GetCopilotCreditsForPeriod(AITTestSuite.Code, AITEvalMonthlyCopilotCreditLimitRecord.GetPeriodStartDate()); + TempAIEvalSuiteUsageBuffer.Insert(); + LoadedDataCopilotCreditsConsumed += TempAIEvalSuiteUsageBuffer.Consumed; until AITTestSuite.Next() = 0; // Sort the buffer by consumed credits in descending order. SortOrder := 0; - AIEvalSuiteUsageBufferTemp.SetCurrentKey(Consumed); + TempAIEvalSuiteUsageBuffer.SetCurrentKey(Consumed); #pragma warning disable AA0233, AA0181 - if AIEvalSuiteUsageBufferTemp.FindLast() then + if TempAIEvalSuiteUsageBuffer.FindLast() then repeat SortOrder += 1; - Rec := AIEvalSuiteUsageBufferTemp; + Rec := TempAIEvalSuiteUsageBuffer; Rec.Index := SortOrder; Rec.Insert(); - until AIEvalSuiteUsageBufferTemp.Next(-1) = 0; + until TempAIEvalSuiteUsageBuffer.Next(-1) = 0; #pragma warning restore AA0233, AA0181 if Rec.FindFirst() then; diff --git a/src/rulesets/CodeCop.ruleset.json b/src/rulesets/CodeCop.ruleset.json index e40bc43fd3..418317f3a1 100644 --- a/src/rulesets/CodeCop.ruleset.json +++ b/src/rulesets/CodeCop.ruleset.json @@ -292,8 +292,7 @@ }, { "id": "AA0073", - "action": "None", - "justification": "Temporary" + "action": "Error" }, { "id": "AA0074", @@ -950,8 +949,7 @@ }, { "id": "AA0237", - "action": "None", - "justification": "Temporary" + "action": "Error" }, { "id": "AA0238",