From f23d2e0110ff7ea0db1b5a7df8a036021f79c0c0 Mon Sep 17 00:00:00 2001 From: Peter <61538034+PTKu@users.noreply.github.com> Date: Wed, 2 Aug 2023 07:59:04 +0200 Subject: [PATCH] mend --- .../expected/.g/Onliners/array_declaration.g.cs | 4 ++-- .../.g/Onliners/compileromitsattribute.g.cs | 6 +++--- .../samples/units/expected/.g/Onliners/misc.g.cs | 4 ++-- .../.g/Onliners/dataswapping/moster.g.cs | 4 ++-- .../.g/Onliners/dataswapping/realmonster.g.cs | 4 ++-- .../integrated.tests/TwinObjectExtensionTests.cs | 15 ++++++++------- 6 files changed, 19 insertions(+), 18 deletions(-) diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/array_declaration.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/array_declaration.g.cs index 2ce06e95..0dc08aac 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/array_declaration.g.cs +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/array_declaration.g.cs @@ -23,9 +23,9 @@ public array_declaration_class(AXSharp.Connector.ITwinObject parent, string read HumanReadable = AXSharp.Connector.Connector.CreateHumanReadable(parent.HumanReadable, readableTail); PreConstruct(parent, readableTail, symbolTail); primitive = new OnlinerInt[100]; - AXSharp.Connector.BuilderHelpers.Arrays.InstantiateArray(primitive, this, "primitive", "primitive", (p, rt, st) => @Connector.ConnectorAdapter.AdapterFactory.CreateINT(p, rt, st), new[]{(1, 100)}); + AXSharp.Connector.BuilderHelpers.Arrays.InstantiateArray(primitive, this, "primitive", "primitive", (p, rt, st) => @Connector.ConnectorAdapter.AdapterFactory.CreateINT(p, rt, st), new[] { (1, 100) }); complex = new ArrayDeclarationSimpleNamespace.some_complex_type[100]; - AXSharp.Connector.BuilderHelpers.Arrays.InstantiateArray(complex, this, "complex", "complex", (p, rt, st) => new ArrayDeclarationSimpleNamespace.some_complex_type(p, rt, st), new[]{(1, 100)}); + AXSharp.Connector.BuilderHelpers.Arrays.InstantiateArray(complex, this, "complex", "complex", (p, rt, st) => new ArrayDeclarationSimpleNamespace.some_complex_type(p, rt, st), new[] { (1, 100) }); parent.AddChild(this); parent.AddKid(this); PostConstruct(parent, readableTail, symbolTail); diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/compileromitsattribute.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/compileromitsattribute.g.cs index 736b319d..c08572b7 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/compileromitsattribute.g.cs +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/compileromitsattribute.g.cs @@ -25,7 +25,7 @@ public ClassWithArrays(AXSharp.Connector.ITwinObject parent, string readableTail PreConstruct(parent, readableTail, symbolTail); _must_be_omitted_in_poco = new CompilerOmmits.Complex(this, "_must_be_omitted_in_poco", "_must_be_omitted_in_poco"); _primitive = new OnlinerByte[11]; - AXSharp.Connector.BuilderHelpers.Arrays.InstantiateArray(_primitive, this, "_primitive", "_primitive", (p, rt, st) => @Connector.ConnectorAdapter.AdapterFactory.CreateBYTE(p, rt, st), new[]{(0, 10)}); + AXSharp.Connector.BuilderHelpers.Arrays.InstantiateArray(_primitive, this, "_primitive", "_primitive", (p, rt, st) => @Connector.ConnectorAdapter.AdapterFactory.CreateBYTE(p, rt, st), new[] { (0, 10) }); parent.AddChild(this); parent.AddKid(this); PostConstruct(parent, readableTail, symbolTail); @@ -1154,9 +1154,9 @@ public ClassWithArrays(AXSharp.Connector.ITwinObject parent, string readableTail HumanReadable = AXSharp.Connector.Connector.CreateHumanReadable(parent.HumanReadable, readableTail); PreConstruct(parent, readableTail, symbolTail); _complexKnown = new UnknownArraysShouldNotBeTraspiled.Complex[11]; - AXSharp.Connector.BuilderHelpers.Arrays.InstantiateArray(_complexKnown, this, "_complexKnown", "_complexKnown", (p, rt, st) => new UnknownArraysShouldNotBeTraspiled.Complex(p, rt, st), new[]{(0, 10)}); + AXSharp.Connector.BuilderHelpers.Arrays.InstantiateArray(_complexKnown, this, "_complexKnown", "_complexKnown", (p, rt, st) => new UnknownArraysShouldNotBeTraspiled.Complex(p, rt, st), new[] { (0, 10) }); _primitive = new OnlinerByte[11]; - AXSharp.Connector.BuilderHelpers.Arrays.InstantiateArray(_primitive, this, "_primitive", "_primitive", (p, rt, st) => @Connector.ConnectorAdapter.AdapterFactory.CreateBYTE(p, rt, st), new[]{(0, 10)}); + AXSharp.Connector.BuilderHelpers.Arrays.InstantiateArray(_primitive, this, "_primitive", "_primitive", (p, rt, st) => @Connector.ConnectorAdapter.AdapterFactory.CreateBYTE(p, rt, st), new[] { (0, 10) }); parent.AddChild(this); parent.AddKid(this); PostConstruct(parent, readableTail, symbolTail); diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/misc.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/misc.g.cs index 5fc7993c..89b7cd50 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/misc.g.cs +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/misc.g.cs @@ -829,9 +829,9 @@ public ClassWithArrays(AXSharp.Connector.ITwinObject parent, string readableTail HumanReadable = AXSharp.Connector.Connector.CreateHumanReadable(parent.HumanReadable, readableTail); PreConstruct(parent, readableTail, symbolTail); _complexKnown = new UnknownArraysShouldNotBeTraspiled.Complex[11]; - AXSharp.Connector.BuilderHelpers.Arrays.InstantiateArray(_complexKnown, this, "_complexKnown", "_complexKnown", (p, rt, st) => new UnknownArraysShouldNotBeTraspiled.Complex(p, rt, st), new[]{(0, 10)}); + AXSharp.Connector.BuilderHelpers.Arrays.InstantiateArray(_complexKnown, this, "_complexKnown", "_complexKnown", (p, rt, st) => new UnknownArraysShouldNotBeTraspiled.Complex(p, rt, st), new[] { (0, 10) }); _primitive = new OnlinerByte[11]; - AXSharp.Connector.BuilderHelpers.Arrays.InstantiateArray(_primitive, this, "_primitive", "_primitive", (p, rt, st) => @Connector.ConnectorAdapter.AdapterFactory.CreateBYTE(p, rt, st), new[]{(0, 10)}); + AXSharp.Connector.BuilderHelpers.Arrays.InstantiateArray(_primitive, this, "_primitive", "_primitive", (p, rt, st) => @Connector.ConnectorAdapter.AdapterFactory.CreateBYTE(p, rt, st), new[] { (0, 10) }); parent.AddChild(this); parent.AddKid(this); PostConstruct(parent, readableTail, symbolTail); diff --git a/src/tests.integrations/integrated/src/integrated.twin/.g/Onliners/dataswapping/moster.g.cs b/src/tests.integrations/integrated/src/integrated.twin/.g/Onliners/dataswapping/moster.g.cs index 636db2b8..1ab6e53b 100644 --- a/src/tests.integrations/integrated/src/integrated.twin/.g/Onliners/dataswapping/moster.g.cs +++ b/src/tests.integrations/integrated/src/integrated.twin/.g/Onliners/dataswapping/moster.g.cs @@ -29,9 +29,9 @@ public MonsterBase(AXSharp.Connector.ITwinObject parent, string readableTail, st Description = @Connector.ConnectorAdapter.AdapterFactory.CreateSTRING(this, "Description", "Description"); Id = @Connector.ConnectorAdapter.AdapterFactory.CreateULINT(this, "Id", "Id"); ArrayOfBytes = new OnlinerByte[4]; - AXSharp.Connector.BuilderHelpers.Arrays.InstantiateArray(ArrayOfBytes, this, "ArrayOfBytes", "ArrayOfBytes", (p, rt, st) => @Connector.ConnectorAdapter.AdapterFactory.CreateBYTE(p, rt, st), new[]{(0, 3)}); + AXSharp.Connector.BuilderHelpers.Arrays.InstantiateArray(ArrayOfBytes, this, "ArrayOfBytes", "ArrayOfBytes", (p, rt, st) => @Connector.ConnectorAdapter.AdapterFactory.CreateBYTE(p, rt, st), new[] { (0, 3) }); ArrayOfDrives = new MonsterData.DriveBase[4]; - AXSharp.Connector.BuilderHelpers.Arrays.InstantiateArray(ArrayOfDrives, this, "ArrayOfDrives", "ArrayOfDrives", (p, rt, st) => new MonsterData.DriveBase(p, rt, st), new[]{(0, 3)}); + AXSharp.Connector.BuilderHelpers.Arrays.InstantiateArray(ArrayOfDrives, this, "ArrayOfDrives", "ArrayOfDrives", (p, rt, st) => new MonsterData.DriveBase(p, rt, st), new[] { (0, 3) }); parent.AddChild(this); parent.AddKid(this); PostConstruct(parent, readableTail, symbolTail); diff --git a/src/tests.integrations/integrated/src/integrated.twin/.g/Onliners/dataswapping/realmonster.g.cs b/src/tests.integrations/integrated/src/integrated.twin/.g/Onliners/dataswapping/realmonster.g.cs index 4873fbcb..2a6356d4 100644 --- a/src/tests.integrations/integrated/src/integrated.twin/.g/Onliners/dataswapping/realmonster.g.cs +++ b/src/tests.integrations/integrated/src/integrated.twin/.g/Onliners/dataswapping/realmonster.g.cs @@ -38,9 +38,9 @@ public RealMonsterBase(AXSharp.Connector.ITwinObject parent, string readableTail TestDateTime = @Connector.ConnectorAdapter.AdapterFactory.CreateDATE_AND_TIME(this, "TestDateTime", "TestDateTime"); TestTimeSpan = @Connector.ConnectorAdapter.AdapterFactory.CreateTIME_OF_DAY(this, "TestTimeSpan", "TestTimeSpan"); ArrayOfBytes = new OnlinerByte[4]; - AXSharp.Connector.BuilderHelpers.Arrays.InstantiateArray(ArrayOfBytes, this, "ArrayOfBytes", "ArrayOfBytes", (p, rt, st) => @Connector.ConnectorAdapter.AdapterFactory.CreateBYTE(p, rt, st), new[]{(0, 3)}); + AXSharp.Connector.BuilderHelpers.Arrays.InstantiateArray(ArrayOfBytes, this, "ArrayOfBytes", "ArrayOfBytes", (p, rt, st) => @Connector.ConnectorAdapter.AdapterFactory.CreateBYTE(p, rt, st), new[] { (0, 3) }); ArrayOfDrives = new RealMonsterData.DriveBaseNested[4]; - AXSharp.Connector.BuilderHelpers.Arrays.InstantiateArray(ArrayOfDrives, this, "ArrayOfDrives", "ArrayOfDrives", (p, rt, st) => new RealMonsterData.DriveBaseNested(p, rt, st), new[]{(0, 3)}); + AXSharp.Connector.BuilderHelpers.Arrays.InstantiateArray(ArrayOfDrives, this, "ArrayOfDrives", "ArrayOfDrives", (p, rt, st) => new RealMonsterData.DriveBaseNested(p, rt, st), new[] { (0, 3) }); parent.AddChild(this); parent.AddKid(this); PostConstruct(parent, readableTail, symbolTail); diff --git a/src/tests.integrations/integrated/tests/integrated.tests/TwinObjectExtensionTests.cs b/src/tests.integrations/integrated/tests/integrated.tests/TwinObjectExtensionTests.cs index b86af126..c3e1ba88 100644 --- a/src/tests.integrations/integrated/tests/integrated.tests/TwinObjectExtensionTests.cs +++ b/src/tests.integrations/integrated/tests/integrated.tests/TwinObjectExtensionTests.cs @@ -357,6 +357,7 @@ public async Task StartPolling_should_update_cyclic_property() public async Task StartPolling_polling_should_continue_until_last_subscriber() { var holderObject = new object(); + var holderObject1 = new object(); //arrange var polling = Entry.Plc.StartPolling_should_update_cyclic_property; @@ -367,27 +368,27 @@ public async Task StartPolling_polling_should_continue_until_last_subscriber() var pos = await polling.DriveA.NestedLevelOne.NestedLevelTwo.NestedLevelThree.Position.GetAsync(); polling.StartPolling(50, holderObject); - polling.StartPolling(150, holderObject); + polling.StartPolling(150, holderObject1); Task.Delay(250).Wait(); - Assert.True(polling.Id.Cyclic != id); - Assert.True(polling.DriveA.NestedLevelOne.NestedLevelTwo.NestedLevelThree.Position.Cyclic != pos); + Assert.NotEqual(id, polling.Id.Cyclic); + Assert.NotEqual(pos, polling.DriveA.NestedLevelOne.NestedLevelTwo.NestedLevelThree.Position.Cyclic); polling.StopPolling(holderObject); Task.Delay(250).Wait(); - + id = polling.Id.Cyclic; pos = polling.DriveA.NestedLevelOne.NestedLevelTwo.NestedLevelThree.Position.Cyclic; Task.Delay(250).Wait(); - Assert.True(polling.Id.Cyclic != id); - Assert.True(polling.DriveA.NestedLevelOne.NestedLevelTwo.NestedLevelThree.Position.Cyclic != pos); + Assert.NotEqual(id, polling.Id.Cyclic); + Assert.NotEqual(pos, polling.DriveA.NestedLevelOne.NestedLevelTwo.NestedLevelThree.Position.Cyclic); - polling.StopPolling(holderObject); + polling.StopPolling(holderObject1); Task.Delay(250).Wait();