Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into 20240619_mme_#6-sup…
Browse files Browse the repository at this point in the history
…port-dynamic-blocks-read-evaluation-graphs-and-block-visibility-parameters
  • Loading branch information
Nihad Karajko committed Jul 17, 2024
2 parents a691804 + a8425f0 commit 2bc9e21
Show file tree
Hide file tree
Showing 62 changed files with 79,240 additions and 418 deletions.
13 changes: 13 additions & 0 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"version": 1,
"isRoot": true,
"tools": {
"netdocgen.runner": {
"version": "0.1.0",
"commands": [
"netdocgen"
],
"rollForward": false
}
}
}
23 changes: 23 additions & 0 deletions .github/workflows/wiki-gen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Wiki genrator

on:
push:
branches: [ master ]

jobs:
build:

runs-on: windows-latest
steps:

- name: Checkout
run: git config --global core.autocrlf true
- uses: actions/checkout@v2
with:
submodules: true
- name: Update Wiki
run: ./update-wiki.sh
shell: bash
env:
ASSEMBLY_PATH: "ACadSharp/bin/Release/net6.0/ACadSharp.dll"
GITHUB_TOKEN: ${{ github.token }}
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "CSUtilities"]
path = CSUtilities
url = https://github.com/DomCR/CSUtilities
[submodule "wiki"]
path = wiki
url = https://github.com/DomCR/ACadSharp.wiki.git
31 changes: 31 additions & 0 deletions ACadSharp.Tests/CadDocumentTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,37 @@ public void ChangeEntityLineType()
Assert.Equal(lineType, doc.LineTypes[lineType.Name]);
}

[Fact]
public void CreateDefaultsExistingDocumentTest()
{
CadDocument doc = new CadDocument();

ulong appIdsHandle = doc.AppIds.Handle;
ulong blksHandle = doc.BlockRecords.Handle;
ulong dimHandle = doc.DimensionStyles.Handle;
ulong layersHandle = doc.Layers.Handle;
ulong ltypesHandle = doc.LineTypes.Handle;
ulong textStyleHandle = doc.TextStyles.Handle;
ulong ucsHandle = doc.UCSs.Handle;
ulong viewsHandle = doc.Views.Handle;
ulong vportsHandle = doc.VPorts.Handle;

doc.CreateDefaults();

//Objects should not be replaced
Assert.Equal(appIdsHandle, doc.AppIds.Handle);
Assert.Equal(blksHandle, doc.BlockRecords.Handle);
Assert.Equal(dimHandle, doc.DimensionStyles.Handle);
Assert.Equal(layersHandle, doc.Layers.Handle);
Assert.Equal(ltypesHandle, doc.LineTypes.Handle);
Assert.Equal(textStyleHandle, doc.TextStyles.Handle);
Assert.Equal(ucsHandle, doc.UCSs.Handle);
Assert.Equal(viewsHandle, doc.Views.Handle);
Assert.Equal(vportsHandle, doc.VPorts.Handle);

this._docIntegrity.AssertDocumentDefaults(doc);
}

[Theory]
[MemberData(nameof(EntityTypes))]
public void DetachedEntityClone(Type entityType)
Expand Down
10 changes: 10 additions & 0 deletions ACadSharp.Tests/Common/CadObjectTestUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,15 @@ public static void AssertTableEntryClone(TableEntry original, TableEntry clone)
Assert.True(clone.Name == original.Name);
Assert.True(clone.Flags == original.Flags);
}

public static void AssertEntityCollection<T>(CadObjectCollection<T> original, CadObjectCollection<T> clone)
where T : Entity
{
Assert.NotEmpty(original);
for (int i = 0; i < original.Count; i++)
{
CadObjectTestUtils.AssertEntityClone(original[i], clone[i]);
}
}
}
}
Loading

0 comments on commit 2bc9e21

Please sign in to comment.