Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
martin1cerny committed Mar 6, 2024
2 parents 2feda62 + 4fd86d7 commit 4ed33f7
Show file tree
Hide file tree
Showing 9 changed files with 4,867 additions and 3,137 deletions.
2 changes: 1 addition & 1 deletion Tests/BinaryDataTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ private static void PixelTextureTestCode(XbimSchemaVersion version)
var data = new List<byte[]>() { new byte[] { 0, 0, 255, 255 }, new byte[] { 0, 255, 255, 255 }, new byte[] { 255, 0, 255, 255 }, new byte[] { 255, 0, 0, 255 } };
using (var model = new MemoryModel(new EntityFactoryIfc4()))
{
var create = new Create(model);
var create = new EntityCreator(model);
using (var txn = model.BeginTransaction(""))
{
var pt = create.PixelTexture(t => {
Expand Down
13 changes: 13 additions & 0 deletions Tests/Ifc4x3Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
using Xbim.Ifc4x3.GeometryResource;
using Xbim.Ifc4x3.MeasureResource;
using Xbim.Ifc4x3.ProductExtension;
using Xbim.IO.Memory;

namespace Xbim.Essentials.Tests
{
Expand Down Expand Up @@ -121,5 +122,17 @@ public void SurfaceDimensionsImplemented()

}
}

[TestMethod]
public void CanCreateEntitiesWithFactory()
{
using var model = new MemoryModel(new EntityFactoryIfc4x3Add2());
using var txn = model.BeginTransaction("Creation");

var c = new EntityCreator(model);
c.Wall(w => w.Name = "First wall");

txn.Commit();
}
}
}
6 changes: 3 additions & 3 deletions Tests/OwnerHistoryTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public void NonEmptyEditorCredentials()
{
using (var txn = model.BeginTransaction())
{
var create = new Create(model);
var create = new EntityCreator(model);
var wall = create.Wall(w => w.Name = "New wall");
Assert.IsNotNull(wall.OwnerHistory);
Assert.IsTrue(model.Instances.Count > 1);
Expand All @@ -33,7 +33,7 @@ public void EmptyEditorCredentials()
model.ManageOwnerHistory = false;
using (var txn = model.BeginTransaction())
{
var create = new Create(model);
var create = new EntityCreator(model);
var wall = create.Wall(w => w.Name = "New wall");
Assert.IsNull(wall.OwnerHistory);
Assert.AreEqual(1, model.Instances.Count);
Expand All @@ -48,7 +48,7 @@ public void NoOwnerHistoryForInsertCopy()
{
using (var txn = source.BeginTransaction())
{
var create = new Create(source);
var create = new EntityCreator(source);
source.ManageOwnerHistory = false;
create.Wall(w => w.Name = "New wall #1");
create.Wall(w => w.Name = "New wall #2");
Expand Down
4 changes: 2 additions & 2 deletions Tests/Pure4Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public void IndependentCreation()

public void CreateDataWithoutInitializers(IModel model)
{
var create = new Create(model);
var create = new EntityCreator(model);
var wall = create.Wall();
wall.PredefinedType = IfcWallTypeEnum.POLYGONAL;
wall.Name = "Name of the perfect wall";
Expand All @@ -37,7 +37,7 @@ public void CreateDataWithoutInitializers(IModel model)

public void CreateDataWithInitializers(IModel model)
{
var create = new Create(model);
var create = new EntityCreator(model);
var wall = create.Wall(w =>
{
w.PredefinedType = IfcWallTypeEnum.POLYGONAL;
Expand Down
2 changes: 1 addition & 1 deletion Tests/ValidationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public void ContextDependentUnitValidationTest()
{
using (var txn = model.BeginTransaction())
{
var c = new Create(model);
var c = new EntityCreator(model);
var unit = c.ContextDependentUnit(u =>
{
u.UnitType = IfcUnitEnum.USERDEFINED;
Expand Down
12 changes: 11 additions & 1 deletion Xbim.Essentials.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,32 @@
</group>
<group targetFramework="netstandard2.1">
<dependency id="Xbim.Common" version="{{version}}" />
<dependency id="Xbim.Ifc" version="{{version}}" />
<dependency id="Xbim.Ifc4" version="{{version}}" />
<dependency id="Xbim.Ifc2x3" version="{{version}}" />
<dependency id="Xbim.Ifc4x3" version="{{version}}" />
<dependency id="Xbim.IO.Esent" version="{{version}}" />
<dependency id="Xbim.IO.MemoryModel" version="{{version}}" />
<dependency id="Xbim.Ifc" version="{{version}}" />
<dependency id="Xbim.Tessellator" version="{{version}}" />
</group>
<group targetFramework="net6.0">
<dependency id="Xbim.Common" version="{{version}}" />
<dependency id="Xbim.Ifc" version="{{version}}" />
<dependency id="Xbim.Ifc4" version="{{version}}" />
<dependency id="Xbim.Ifc2x3" version="{{version}}" />
<dependency id="Xbim.Ifc4x3" version="{{version}}" />
<dependency id="Xbim.IO.Esent" version="{{version}}" />
<dependency id="Xbim.IO.MemoryModel" version="{{version}}" />
<dependency id="Xbim.Tessellator" version="{{version}}" />
</group>
<group targetFramework="net8.0">
<dependency id="Xbim.Common" version="{{version}}" />
<dependency id="Xbim.Ifc" version="{{version}}" />
<dependency id="Xbim.Ifc4" version="{{version}}" />
<dependency id="Xbim.Ifc2x3" version="{{version}}" />
<dependency id="Xbim.Ifc4x3" version="{{version}}" />
<dependency id="Xbim.IO.Esent" version="{{version}}" />
<dependency id="Xbim.IO.MemoryModel" version="{{version}}" />
<dependency id="Xbim.Tessellator" version="{{version}}" />
</group>
</dependencies>
Expand Down
Loading

0 comments on commit 4ed33f7

Please sign in to comment.