Skip to content

Commit

Permalink
Add one more replication test (#13350)
Browse files Browse the repository at this point in the history
* add nunit test adapter for 2022 (#13313)

* add nunit test adapter for 2022

* update

* Update Setup.cs

* update

* Update DynamoCore.csproj

* Create System.Net.Http.dll

* update

* update

Co-authored-by: pinzart <[email protected]>

* Filter Mouse Pressed Removed (#13319)

- removed flashing white color on mouse pressed for the filter ui element

* Fixing horizontal center (#13312)

* Update Node AutoComplete Dialog Visuals (#13329)

* Update Node AutoComplete Visuals

* Reuse style from central location

* Add editorconfig (#13233)

* Dyn5272 (#13334)

tests pass - merging this then will send cherry pick

* Dyn 5159 import export preferences (#13301)

* Import Export Settings

* Info Icons

* Indentation

* Using Dynamo View Model reference

* Moving the methods to the proper places according to their accessibility

* Handling Generic Exceptions

* updating the RaisePropertyChanged

* Extracting the import extension file as a variable

* Unique file name

* Changing the access level

* Various revisions

* Cleaning vars

* Adding Unit Test

* Adding Comments and cleaning vars

* Removing unnecessary methods

* Refactoring to get the static fields automatically

* Updating the Unit Test

* checking new settings file

* Adding validation info

* Getting First Property with the same value

* Updating valid TrustedLocations entries

* move near clipping plane further away for more depth buffer precision. (#13338)

passed here:
merging.

* add more failing tests

* implement case 2 of replication

* Update ReplicationTests.cs

* add failing test

* add some more failing tests

* add replication test

* fix merge conflict

* fix merge conflict

Co-authored-by: pinzart90 <[email protected]>
Co-authored-by: pinzart <[email protected]>
Co-authored-by: Deyan Nenov <[email protected]>
Co-authored-by: jesusalvino <[email protected]>
Co-authored-by: Aaron (Qilong) <[email protected]>
Co-authored-by: Aabishkar KC <[email protected]>
Co-authored-by: Michael Kirschner <[email protected]>
Co-authored-by: kirschm <[email protected]>
  • Loading branch information
9 people authored Sep 28, 2022
1 parent 75c2f6f commit 1cb5053
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/CodeGenILTests/CodeGenILTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<AssemblyName>CodeGenILTests</AssemblyName>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="DynamoVisualProgramming.LibG_228_0_0" Version="2.16.0.2441" />
<PackageReference Include="NUnit" Version="2.6.3" />
</ItemGroup>
<ItemGroup>
Expand Down
46 changes: 46 additions & 0 deletions test/CodeGenILTests/ReplicationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ public void ZTLongestLacing_ShouldReturn3Lists_2Guides2()
var result = output["list3"];
Assert.AreEqual(expectedResult, result);
}

[Test]
public void ZTLongestLacing_ShouldReturn6Lists_2Guides()
{
Expand Down Expand Up @@ -227,6 +228,7 @@ public void ZTShortestLacing_ShouldReturnSingleItem_AndBeDefault()
var result = output["list3"];
Assert.AreEqual(expectedResult, result);
}

[Test]
public void ZTShortestLacing_ShouldReturnSingleItem_WithSameGuide()
{
Expand All @@ -245,6 +247,7 @@ public void ZTShortestLacing_ShouldReturnSingleItem_WithSameGuide()
var result = output["list3"];
Assert.AreEqual(expectedResult, result);
}

[Test]
public void ZTShortestLacing_ShouldReturn2Results_NoGuides()
{
Expand All @@ -263,6 +266,7 @@ public void ZTShortestLacing_ShouldReturn2Results_NoGuides()
var result = output["list3"];
Assert.AreEqual(expectedResult, result);
}

[Test]
public void ZTShortestLacing_ShouldReturn2Lists_NoGuides()
{
Expand All @@ -281,6 +285,7 @@ public void ZTShortestLacing_ShouldReturn2Lists_NoGuides()
var result = output["list3"];
Assert.AreEqual(expectedResult, result);
}

[Test]
public void ZTShortestLacing_ArbitraryRank_ReplicateFirstArg()
{
Expand Down Expand Up @@ -323,6 +328,7 @@ public void ZTShortestLacing_ArbitraryRank_ReplicateBothArgs()
Assert.AreEqual(expectedResult, result);
}
#endregion

[Test]
public void MSIL_Arithmetic_No_Replication()
{
Expand Down Expand Up @@ -463,6 +469,46 @@ private bool AreEqual(object a, object b)
return false;
}

[Test]
public void CrossProductReplication_ResultPassedAs2DArray()
{
string code =
@"
import(""ProtoGeometry.dll"");
import(""DesignScriptBuiltin.dll"");
import(""DSCoreNodes.dll"");
t1 = (1..3);
point1 = Autodesk.DesignScript.Geometry.Point.ByCoordinates(t1<1>, t1<2>, 0);
nurbsCurve1 = Autodesk.DesignScript.Geometry.NurbsCurve.ByPoints(point1);
";
var ast = ParserUtils.Parse(code).Body;
var output = codeGen.EmitAndExecute(ast);
Assert.IsNotEmpty(output);

Assert.AreEqual(new long[] { 1, 2, 3 }, output["t1"]);
var pointGrid = output["point1"] as object[];
Assert.NotNull(pointGrid);
Assert.AreEqual(3, pointGrid.Length);
foreach (var row in pointGrid)
{
var ptRow = row as object[];
Assert.NotNull(ptRow);

Assert.AreEqual(3, ptRow.Length);
Assert.True(ptRow[0] is Autodesk.DesignScript.Geometry.Point);
Assert.True(ptRow[1] is Autodesk.DesignScript.Geometry.Point);
Assert.True(ptRow[2] is Autodesk.DesignScript.Geometry.Point);
}
var nurbs = output["nurbsCurve1"] as object[];
Assert.NotNull(nurbs);

Assert.AreEqual(3, nurbs.Length);
foreach (var obj in nurbs)
{
Assert.True(obj is Autodesk.DesignScript.Geometry.NurbsCurve);
}
}

[Test]
public void MSIL_FuncCall_Double_SomeGuides()
{
Expand Down

0 comments on commit 1cb5053

Please sign in to comment.