Skip to content

Commit

Permalink
Merge pull request #32 from NovoaDev/30-test-temporarytablestest
Browse files Browse the repository at this point in the history
  • Loading branch information
NovoaDev authored Jul 25, 2023
2 parents 5b9472a + 549ca60 commit 397ab0a
Show file tree
Hide file tree
Showing 29 changed files with 1,169 additions and 481 deletions.
8 changes: 6 additions & 2 deletions Dependency-Graph.Test/DepGraphTestANJ.permissionset.al
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
/// <summary>
/// permissionset DepGraphTest_ANJ (ID 99990).
/// </summary>
permissionset 99990 DepGraphTest_ANJ
{
Access = Public;
Assignable = true;
Permissions = codeunit GenerateFiguresTest_ANJ = X,
codeunit GraphAndMarkdownTest_ANJ = X,
Permissions = codeunit ExpectedValues_ANJ = X,
codeunit FillingProTablesMock_ANJ = X,
codeunit GenerateFiguresTest_ANJ = X,
codeunit NumberSequenceTest_ANJ = X,
codeunit TemporaryTablesTest_ANJ = X;
}
115 changes: 115 additions & 0 deletions Dependency-Graph.Test/Translations/Dependency-Graph.Test.g.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,106 @@
<file datatype="xml" source-language="en-US" target-language="en-US" original="Dependency-Graph.Test">
<body>
<group id="body">
<trans-unit id="Codeunit 1107496048 - NamedType 283617910" size-unit="char" translate="yes" xml:space="preserve">
<source>E1[Take Order Sample] --&gt; E2[DependencyGraph]</source>
<note from="Developer" annotates="general" priority="2"></note>
<note from="Xliff Generator" annotates="general" priority="3">Codeunit ExpectedValues_ANJ - NamedType ExpectedRelationLbl</note>
</trans-unit>
<trans-unit id="Codeunit 1107496048 - NamedType 1699462585" size-unit="char" translate="yes" xml:space="preserve">
<source>```</source>
<note from="Developer" annotates="general" priority="2"></note>
<note from="Xliff Generator" annotates="general" priority="3">Codeunit ExpectedValues_ANJ - NamedType FooterLbl</note>
</trans-unit>
<trans-unit id="Codeunit 1107496048 - NamedType 2619639984" size-unit="char" translate="yes" xml:space="preserve">
<source>```mermaid</source>
<note from="Developer" annotates="general" priority="2"></note>
<note from="Xliff Generator" annotates="general" priority="3">Codeunit ExpectedValues_ANJ - NamedType Header1Lbl</note>
</trans-unit>
<trans-unit id="Codeunit 1107496048 - NamedType 1609892177" size-unit="char" translate="yes" xml:space="preserve">
<source>graph BT</source>
<note from="Developer" annotates="general" priority="2"></note>
<note from="Xliff Generator" annotates="general" priority="3">Codeunit ExpectedValues_ANJ - NamedType Header2Lbl</note>
</trans-unit>
<trans-unit id="Codeunit 1642682097 - NamedType 3993970854" size-unit="char" translate="yes" xml:space="preserve">
<source>DestinationAppID</source>
<note from="Developer" annotates="general" priority="2"></note>
<note from="Xliff Generator" annotates="general" priority="3">Codeunit FillingProTablesMock_ANJ - NamedType DestinationAppIDLbl</note>
</trans-unit>
<trans-unit id="Codeunit 1642682097 - NamedType 4198159985" size-unit="char" translate="yes" xml:space="preserve">
<source>displayName</source>
<note from="Developer" annotates="general" priority="2"></note>
<note from="Xliff Generator" annotates="general" priority="3">Codeunit FillingProTablesMock_ANJ - NamedType DisplayNameLbl</note>
</trans-unit>
<trans-unit id="Codeunit 1642682097 - NamedType 2393608217" size-unit="char" translate="yes" xml:space="preserve">
<source>a1f81352-6244-48a4-96a0-a81c5aaaa581</source>
<note from="Developer" annotates="general" priority="2"></note>
<note from="Xliff Generator" annotates="general" priority="3">Codeunit FillingProTablesMock_ANJ - NamedType Ext01IDLbl</note>
</trans-unit>
<trans-unit id="Codeunit 1642682097 - NamedType 1039689151" size-unit="char" translate="yes" xml:space="preserve">
<source>Take Order Sample</source>
<note from="Developer" annotates="general" priority="2"></note>
<note from="Xliff Generator" annotates="general" priority="3">Codeunit FillingProTablesMock_ANJ - NamedType Ext01NameLbl</note>
</trans-unit>
<trans-unit id="Codeunit 1642682097 - NamedType 2471922624" size-unit="char" translate="yes" xml:space="preserve">
<source>BusinessCentralDemos</source>
<note from="Developer" annotates="general" priority="2"></note>
<note from="Xliff Generator" annotates="general" priority="3">Codeunit FillingProTablesMock_ANJ - NamedType Ext01PublisherLbl</note>
</trans-unit>
<trans-unit id="Codeunit 1642682097 - NamedType 3053848200" size-unit="char" translate="yes" xml:space="preserve">
<source>3c9a4c22-42f6-4e8f-8b96-744c7fef331f</source>
<note from="Developer" annotates="general" priority="2"></note>
<note from="Xliff Generator" annotates="general" priority="3">Codeunit FillingProTablesMock_ANJ - NamedType Ext02IDLbl</note>
</trans-unit>
<trans-unit id="Codeunit 1642682097 - NamedType 3747003922" size-unit="char" translate="yes" xml:space="preserve">
<source>Dependency-Graph</source>
<note from="Developer" annotates="general" priority="2"></note>
<note from="Xliff Generator" annotates="general" priority="3">Codeunit FillingProTablesMock_ANJ - NamedType Ext02NameLbl</note>
</trans-unit>
<trans-unit id="Codeunit 1642682097 - NamedType 1333445049" size-unit="char" translate="yes" xml:space="preserve">
<source>ANJ</source>
<note from="Developer" annotates="general" priority="2"></note>
<note from="Xliff Generator" annotates="general" priority="3">Codeunit FillingProTablesMock_ANJ - NamedType Ext02PublisherLbl</note>
</trans-unit>
<trans-unit id="Codeunit 1642682097 - NamedType 2272053225" size-unit="char" translate="yes" xml:space="preserve">
<source>id</source>
<note from="Developer" annotates="general" priority="2"></note>
<note from="Xliff Generator" annotates="general" priority="3">Codeunit FillingProTablesMock_ANJ - NamedType IdLbl</note>
</trans-unit>
<trans-unit id="Codeunit 1642682097 - NamedType 177224252" size-unit="char" translate="yes" xml:space="preserve">
<source>isInstalled</source>
<note from="Developer" annotates="general" priority="2"></note>
<note from="Xliff Generator" annotates="general" priority="3">Codeunit FillingProTablesMock_ANJ - NamedType IsInstalledLbl</note>
</trans-unit>
<trans-unit id="Codeunit 1642682097 - NamedType 3329916367" size-unit="char" translate="yes" xml:space="preserve">
<source>packageId</source>
<note from="Developer" annotates="general" priority="2"></note>
<note from="Xliff Generator" annotates="general" priority="3">Codeunit FillingProTablesMock_ANJ - NamedType PackageIdLbl</note>
</trans-unit>
<trans-unit id="Codeunit 1642682097 - NamedType 2135136892" size-unit="char" translate="yes" xml:space="preserve">
<source>publishedAs</source>
<note from="Developer" annotates="general" priority="2"></note>
<note from="Xliff Generator" annotates="general" priority="3">Codeunit FillingProTablesMock_ANJ - NamedType PublishedAsLbl</note>
</trans-unit>
<trans-unit id="Codeunit 1642682097 - NamedType 783871344" size-unit="char" translate="yes" xml:space="preserve">
<source>publisher</source>
<note from="Developer" annotates="general" priority="2"></note>
<note from="Xliff Generator" annotates="general" priority="3">Codeunit FillingProTablesMock_ANJ - NamedType PublisherLbl</note>
</trans-unit>
<trans-unit id="Codeunit 1642682097 - NamedType 1618117332" size-unit="char" translate="yes" xml:space="preserve">
<source>PTE</source>
<note from="Developer" annotates="general" priority="2"></note>
<note from="Xliff Generator" annotates="general" priority="3">Codeunit FillingProTablesMock_ANJ - NamedType ScopeLbl</note>
</trans-unit>
<trans-unit id="Codeunit 1642682097 - NamedType 1408304205" size-unit="char" translate="yes" xml:space="preserve">
<source>SourceAppID</source>
<note from="Developer" annotates="general" priority="2"></note>
<note from="Xliff Generator" annotates="general" priority="3">Codeunit FillingProTablesMock_ANJ - NamedType SourceAppIDLbl</note>
</trans-unit>
<trans-unit id="Codeunit 1642682097 - NamedType 2442600875" size-unit="char" translate="yes" xml:space="preserve">
<source>value</source>
<note from="Developer" annotates="general" priority="2"></note>
<note from="Xliff Generator" annotates="general" priority="3">Codeunit FillingProTablesMock_ANJ - NamedType ValueLbl</note>
</trans-unit>
<trans-unit id="Codeunit 3159861850 - NamedType 4030770184" size-unit="char" translate="yes" xml:space="preserve">
<source>App</source>
<note from="Developer" annotates="general" priority="2"></note>
Expand Down Expand Up @@ -53,6 +153,21 @@
<note from="Developer" annotates="general" priority="2"></note>
<note from="Xliff Generator" annotates="general" priority="3">Codeunit NumberSequenceTest_ANJ - NamedType ThirdRequestLbl</note>
</trans-unit>
<trans-unit id="Codeunit 1511997686 - NamedType 3734207983" size-unit="char" translate="yes" xml:space="preserve">
<source>Diferent number of records in table %1 than expected</source>
<note from="Developer" annotates="general" priority="2"></note>
<note from="Xliff Generator" annotates="general" priority="3">Codeunit TemporaryTablesTest_ANJ - NamedType DiferentNumberErr</note>
</trans-unit>
<trans-unit id="Codeunit 1511997686 - NamedType 3232656297" size-unit="char" translate="yes" xml:space="preserve">
<source>Markdown text is different than expected</source>
<note from="Developer" annotates="general" priority="2"></note>
<note from="Xliff Generator" annotates="general" priority="3">Codeunit TemporaryTablesTest_ANJ - NamedType MarkdownTextErr</note>
</trans-unit>
<trans-unit id="EnumExtension 2370418707 - EnumValue 983320492 - Property 2879900210" size-unit="char" translate="yes" xml:space="preserve" al-object-target="Enum 1956450053">
<source>Mock</source>
<note from="Developer" annotates="general" priority="2">ESP="WS y Mock"</note>
<note from="Xliff Generator" annotates="general" priority="3">EnumExtension FillingProcessTablesMock_ANJ - EnumValue Mock_ANJ - Property Caption</note>
</trans-unit>
</group>
</body>
</file>
Expand Down
Binary file not shown.
44 changes: 44 additions & 0 deletions Dependency-Graph.Test/src/Test/ExpectedValuesANJ.Codeunit.al
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/// <summary>
/// Codeunit ExpectedValues_ANJ (ID 99994).
/// </summary>
codeunit 99994 ExpectedValues_ANJ
{
Access = Internal;

/// <summary>
/// GetExpectedMarkdownText.
/// </summary>
/// <returns>Return value of type Text.</returns>
procedure GetExpectedMarkdownText(): Text;
var
ExpectedValueTextBuilder: TextBuilder;
begin
ExpectedValueTextBuilder.AppendLine(Header1Lbl);
ExpectedValueTextBuilder.AppendLine(Header2Lbl);
ExpectedValueTextBuilder.AppendLine(ExpectedRelationLbl);
ExpectedValueTextBuilder.AppendLine();
ExpectedValueTextBuilder.AppendLine(FooterLbl);

exit(ExpectedValueTextBuilder.ToText());
end;

/// <summary>
/// GetExpectedMarkdownMermaidText.
/// </summary>
/// <returns>Return value of type Text.</returns>
procedure GetExpectedMarkdownMermaidText(): Text;
var
ExpectedValueTextBuilder: TextBuilder;
begin
ExpectedValueTextBuilder.AppendLine(Header2Lbl);
ExpectedValueTextBuilder.AppendLine(ExpectedRelationLbl);

exit(ExpectedValueTextBuilder.ToText());
end;

var
ExpectedRelationLbl: Label 'E1[Take Order Sample] --> E2[DependencyGraph]';
FooterLbl: Label '```';
Header1Lbl: Label '```mermaid';
Header2Lbl: Label 'graph BT';
}
116 changes: 116 additions & 0 deletions Dependency-Graph.Test/src/Test/FillingProTablesMockANJ.Codeunit.al
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
/// <summary>
/// Codeunit "FillingProTablesMock_ANJ" (ID 99993).
/// </summary>
codeunit 99993 FillingProTablesMock_ANJ implements FillingProcessingTables_ANJ
{
Access = Internal;

/// <summary>
/// GetExtensions.
/// </summary>
/// <returns>Return value of type Text.</returns>
procedure GetExtensions(): Text;
var
ExtensionArry: JsonArray;
AuxJsonObject: JsonObject;
Extensions: Text;
begin
AddNewExtensionToJsonArry(
ExtensionArry,
Ext01IDLbl,
Ext01NameLbl,
Ext01PublisherLbl,
ScopeLbl);

AddNewExtensionToJsonArry(
ExtensionArry,
Ext02IDLbl,
Ext02NameLbl,
Ext02PublisherLbl,
ScopeLbl);

AuxJsonObject.Add(ValueLbl, ExtensionArry);
AuxJsonObject.WriteTo(Extensions);

exit(Extensions);
end;

/// <summary>
/// GetRelations.
/// </summary>
/// <returns>Return value of type Text.</returns>
procedure GetRelations(): Text;
var
RelationsArry: JsonArray;
Relations: Text;
begin
AddNewRelationToJsonArry(RelationsArry,
Ext01IDLbl,
Ext02IDLbl);
RelationsArry.WriteTo(Relations);

exit(Relations);
end;

/// <summary>
/// AddNewExtensionToJsonArry.
/// </summary>
/// <param name="ExtensionArry">VAR JsonArray.</param>
/// <param name="PackageId">Text.</param>
/// <param name="DisplayName">Text.</param>
/// <param name="Publisher">Text.</param>
/// <param name="PublishedAs">Text.</param>
internal procedure AddNewExtensionToJsonArry(
var ExtensionArry: JsonArray;
PackageId: Text;
DisplayName: Text;
Publisher: Text;
PublishedAs: Text);
var
ExtensionJsonObject: JsonObject;
begin
ExtensionJsonObject.Add(IdLbl, PackageId);
ExtensionJsonObject.Add(PackageIdLbl, PackageId);
ExtensionJsonObject.Add(DisplayNameLbl, DisplayName);
ExtensionJsonObject.Add(PublisherLbl, Publisher);
ExtensionJsonObject.Add(PublishedAsLbl, PublishedAs);
ExtensionJsonObject.Add(IsInstalledLbl, true);

ExtensionArry.Add(ExtensionJsonObject);
end;

/// <summary>
/// AddNewRelationToJsonArry.
/// /// </summary>
/// <returns>Return variable NewRelationsLine of type Integer.</returns>
local procedure AddNewRelationToJsonArry(
var RelationsArry: JsonArray;
SourceAppID: Guid;
DestinationAppID: Guid);
var
RelationJsonObject: JsonObject;
begin
RelationJsonObject.Add(SourceAppIDLbl, SourceAppID);
RelationJsonObject.Add(DestinationAppIDLbl, DestinationAppID);

RelationsArry.Add(RelationJsonObject);
end;

var
DestinationAppIDLbl: Label 'DestinationAppID';
DisplayNameLbl: Label 'displayName';
Ext01IDLbl: Label 'a1f81352-6244-48a4-96a0-a81c5aaaa581';
Ext01NameLbl: Label 'Take Order Sample';
Ext01PublisherLbl: Label 'BusinessCentralDemos';
Ext02IDLbl: Label '3c9a4c22-42f6-4e8f-8b96-744c7fef331f';
Ext02NameLbl: Label 'Dependency-Graph';
Ext02PublisherLbl: Label 'ANJ';
IdLbl: Label 'id';
IsInstalledLbl: Label 'isInstalled';
PackageIdLbl: Label 'packageId';
PublishedAsLbl: Label 'publishedAs';
PublisherLbl: Label 'publisher';
ScopeLbl: Label 'PTE';
SourceAppIDLbl: Label 'SourceAppID';
ValueLbl: Label 'value';
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/// <summary>
/// EnumExtension FillingProcessingTablesMock_ANJ (ID 99990) extends Record FillingProcessingTables_ANJ.
/// </summary>
enumextension 99990 FillingProcessTablesMock_ANJ extends FillingProcessingTables_ANJ
{
value(99990; Mock_ANJ)
{
Caption = 'Mock', comment = 'ESP="WS y Mock"';
Implementation = FillingProcessingTables_ANJ = FillingProTablesMock_ANJ;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ codeunit 99991 GenerateFiguresTest_ANJ
Subtype = Test;
TestPermissions = Disabled;

/// <summary>
/// GenerateFigures.
/// </summary>
[Test]
procedure GenerateFigures();
var
Expand All @@ -24,9 +27,9 @@ codeunit 99991 GenerateFiguresTest_ANJ
GetFigureText(ScopeDevFigure, ScopeGlobalFigure, ScopePTEFigure);

// [Then] Verify:
LibraryAssert.AreEqual(ScopePTEFigure, StrSubstNo(SquareRectangleFigureLbl, IdentityLbl, AppNameLbl), StrSubstNo(GenerateFigureErr));
LibraryAssert.AreEqual(ScopeGlobalFigure, StrSubstNo(CircleFigureLbl, IdentityLbl, AppNameLbl), StrSubstNo(GenerateFigureErr));
LibraryAssert.AreEqual(ScopeDevFigure, StrSubstNo(RhombusFigureLbl, IdentityLbl, AppNameLbl), StrSubstNo(GenerateFigureErr));
LibraryAssert.AreEqual(ScopePTEFigure, StrSubstNo(SquareRectangleFigureLbl, IdentityLbl, AppNameLbl), GenerateFigureErr);
LibraryAssert.AreEqual(ScopeGlobalFigure, StrSubstNo(CircleFigureLbl, IdentityLbl, AppNameLbl), GenerateFigureErr);
LibraryAssert.AreEqual(ScopeDevFigure, StrSubstNo(RhombusFigureLbl, IdentityLbl, AppNameLbl), GenerateFigureErr);
end;

/// <summary>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ codeunit 99990 NumberSequenceTest_ANJ
Access = Public;
Subtype = Test;

/// <summary>
/// TestNumberSequence.
/// </summary>
[Test]
procedure TestNumberSequence();
var
Expand Down
Loading

0 comments on commit 397ab0a

Please sign in to comment.