Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Kurpanik committed Dec 1, 2021
2 parents 1b45197 + 494c4f9 commit 744ff7c
Show file tree
Hide file tree
Showing 81 changed files with 1,416 additions and 659 deletions.
43 changes: 0 additions & 43 deletions src/Gldf.Net.Tests/DomainTests/EmitterReferencesTest.cs

This file was deleted.

34 changes: 34 additions & 0 deletions src/Gldf.Net.Tests/DomainTests/EmitterTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
using FluentAssertions;
using Gldf.Net.Domain.Definition;
using Gldf.Net.Domain.Definition.Types;
using Gldf.Net.Domain.Product.Types;
using NUnit.Framework;

namespace Gldf.Net.Tests.DomainTests
{
[TestFixture]
public class EmitterTests
{
[Test]
public void GetLightEmitters_Should_Return_Expected()
{
var possibleFittings = new EmitterBase[] { new LightEmitter(), new LightEmitter() };
var emitter = new Emitter { PossibleFittings = possibleFittings };

var lightEmitters = emitter.GetLightEmitters();

lightEmitters.Should().BeEquivalentTo(possibleFittings);
}

[Test]
public void GetSensorEmitters_Should_Return_Expected()
{
var possibleFittings = new EmitterBase[] { new SensorEmitter(), new SensorEmitter() };
var emitter = new Emitter { PossibleFittings = possibleFittings };

var sensorEmitters = emitter.GetSensorEmitters();

sensorEmitters.Should().BeEquivalentTo(possibleFittings);
}
}
}
2 changes: 2 additions & 0 deletions src/Gldf.Net.Tests/Gldf.Net.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
<EmbeddedResource Include="TestData\ControlGears\ControlGearCompleteXml.xml" />
<EmbeddedResource Include="TestData\ControlGears\ControlGearMandatoryXml.xml" />
<EmbeddedResource Include="TestData\Descriptive\DescriptiveAttributesXml.xml" />
<EmbeddedResource Include="TestData\Emitters\EmitterCompleteXml.xml" />
<EmbeddedResource Include="TestData\Emitters\EmitterMandatoryXml.xml" />
<EmbeddedResource Include="TestData\Equipments\EquipmentCompleteXml.xml" />
<EmbeddedResource Include="TestData\Equipments\EquipmentMandatoryXml.xml" />
<EmbeddedResource Include="TestData\Files\FilesCompleteXml.xml" />
Expand Down
6 changes: 6 additions & 0 deletions src/Gldf.Net.Tests/ModelSerializationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@ public void SerializeAndDeserialize_Model_Should_BeSameAs_Origin(Root model, str
new TestCaseData(EmbeddedXmlTestData.GetEquipmentCompleteModel(),
EmbeddedXmlTestData.GetEquipmentCompleteXml())
{TestName = "Equipment complete property set"},
new TestCaseData(EmbeddedXmlTestData.GetEmitterMandatoryModel(),
EmbeddedXmlTestData.GetEmitterMandatoryXml())
{TestName = "Emitter mandatory property set"},
new TestCaseData(EmbeddedXmlTestData.GetEmitterCompleteModel(),
EmbeddedXmlTestData.GetEmitterCompleteXml())
{TestName = "Emitter complete property set"},
new TestCaseData(EmbeddedXmlTestData.GetGeometryMandatoryModel(),
EmbeddedXmlTestData.GetGeometryMandatoryXml())
{TestName = "Geometry mandatory property set"},
Expand Down
Binary file modified src/Gldf.Net.Tests/TestData/Container/GldfWithFiles.gldf
Binary file not shown.
Binary file modified src/Gldf.Net.Tests/TestData/Container/GldfWithHeaderMandatory.gldf
Binary file not shown.
Binary file modified src/Gldf.Net.Tests/TestData/Container/GldfWithInvalidRoot.gldf
Binary file not shown.
Binary file modified src/Gldf.Net.Tests/TestData/Container/GldfWithLargeFiles.gldf
Binary file not shown.
Binary file modified src/Gldf.Net.Tests/TestData/Container/GldfWithMissingFiles.gldf
Binary file not shown.
Binary file modified src/Gldf.Net.Tests/TestData/Container/GldfWithNoFiles.gldf
Binary file not shown.
Binary file modified src/Gldf.Net.Tests/TestData/Container/GldfWithOrphanedFiles.gldf
Binary file not shown.
Binary file modified src/Gldf.Net.Tests/TestData/Container/GldfWithSignature.gldf
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ public class ControlGearCompleteModel
},
EnergyLabels = new[]
{
new EnergyLabel {Region = "eu", Label = "A+"},
new EnergyLabel {Region = "us", Label = "B"}
new EnergyLabel { Region = "eu", Label = "A+" },
new EnergyLabel { Region = "us", Label = "B" }
}
},
new ControlGear
Expand Down Expand Up @@ -107,6 +107,20 @@ public class ControlGearCompleteModel
Interface.DmxRdm
}
}
},
Emitters = new[]
{
new Emitter
{
Id = "emitter",
PossibleFittings = new EmitterBase[]
{
new LightEmitter
{
PhotometryId = "photometry"
}
}
}
}
},
ProductDefinitions = new ProductDefinitions
Expand Down Expand Up @@ -139,12 +153,9 @@ public class ControlGearCompleteModel
{
new Locale { Language = "en", Text = "Variant 1" }
},
EmitterReferences = new EmitterReferences
Reference = new EmitterReference
{
Reference = new LightEmitterReference
{
PhotometryId = "photometry"
}
EmitterId = "emitter"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://gldf.io/xsd/gldf/0.9-beta.6/gldf.xsd">
xsi:noNamespaceSchemaLocation="https://gldf.io/xsd/gldf/0.9-beta.7/gldf.xsd">
<Header>
<Manufacturer>DIAL</Manufacturer>
<CreationTimeCode>2021-03-29T14:30:00Z</CreationTimeCode>
Expand Down Expand Up @@ -62,6 +62,11 @@
</Interfaces>
</ControlGear>
</ControlGears>
<Emitters>
<Emitter id="emitter">
<LightEmitter photometryId="photometry" />
</Emitter>
</Emitters>
</GeneralDefinitions>
<ProductDefinitions>
<ProductMetaData>
Expand All @@ -77,9 +82,7 @@
<VariantName>
<Locale language="en">Variant 1</Locale>
</VariantName>
<EmitterReferences>
<LightEmitterReference photometryId="photometry" />
</EmitterReferences>
<EmitterReference emitterId="emitter"/>
</Variant>
</Variants>
</ProductDefinitions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,20 @@ public class ControlGearMandatoryModel
}
}
}
},
Emitters = new[]
{
new Emitter
{
Id = "emitter",
PossibleFittings = new EmitterBase[]
{
new LightEmitter
{
PhotometryId = "photometry"
}
}
}
}
},
ProductDefinitions = new ProductDefinitions
Expand Down Expand Up @@ -88,12 +102,9 @@ public class ControlGearMandatoryModel
{
new Locale { Language = "en", Text = "Variant 1" }
},
EmitterReferences = new EmitterReferences
Reference = new EmitterReference
{
Reference = new LightEmitterReference
{
PhotometryId = "photometry"
}
EmitterId = "emitter"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://gldf.io/xsd/gldf/0.9-beta.6/gldf.xsd">
xsi:noNamespaceSchemaLocation="https://gldf.io/xsd/gldf/0.9-beta.7/gldf.xsd">
<Header>
<Manufacturer>DIAL</Manufacturer>
<CreationTimeCode>2021-03-29T14:30:00Z</CreationTimeCode>
Expand All @@ -23,6 +23,11 @@
</Description>
</ControlGear>
</ControlGears>
<Emitters>
<Emitter id="emitter">
<LightEmitter photometryId="photometry" />
</Emitter>
</Emitters>
</GeneralDefinitions>
<ProductDefinitions>
<ProductMetaData>
Expand All @@ -38,9 +43,7 @@
<VariantName>
<Locale language="en">Variant 1</Locale>
</VariantName>
<EmitterReferences>
<LightEmitterReference photometryId="photometry" />
</EmitterReferences>
<EmitterReference emitterId="emitter"/>
</Variant>
</Variants>
</ProductDefinitions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,20 @@ public class DescriptiveAttributesModel
FileId = "eulumdat"
}
}
},
Emitters = new[]
{
new Emitter
{
Id = "emitter",
PossibleFittings = new EmitterBase[]
{
new LightEmitter
{
PhotometryId = "photometry"
}
}
}
}
},
ProductDefinitions = new ProductDefinitions
Expand Down Expand Up @@ -76,12 +90,9 @@ public class DescriptiveAttributesModel
{
new Locale { Language = "en", Text = "Variant 1" }
},
EmitterReferences = new EmitterReferences
Reference = new EmitterReference
{
Reference = new LightEmitterReference
{
PhotometryId = "photometry"
}
EmitterId = "emitter"
},
VariantDescriptiveAttributes = new DescriptiveAttributes
{
Expand Down Expand Up @@ -190,12 +201,9 @@ public class DescriptiveAttributesModel
{
new Locale { Language = "en", Text = "Variant 2" }
},
EmitterReferences = new EmitterReferences
Reference = new EmitterReference
{
Reference = new LightEmitterReference
{
PhotometryId = "photometry"
}
EmitterId = "emitter"
},
VariantDescriptiveAttributes = new DescriptiveAttributes
{
Expand Down Expand Up @@ -381,12 +389,9 @@ public class DescriptiveAttributesModel
{
new Locale { Language = "en", Text = "Variant 3" }
},
EmitterReferences = new EmitterReferences
Reference = new EmitterReference
{
Reference = new LightEmitterReference
{
PhotometryId = "photometry"
}
EmitterId = "emitter"
},
VariantDescriptiveAttributes = new DescriptiveAttributes
{
Expand All @@ -409,12 +414,9 @@ public class DescriptiveAttributesModel
{
new Locale { Language = "en", Text = "Variant 4" }
},
EmitterReferences = new EmitterReferences
Reference = new EmitterReference
{
Reference = new LightEmitterReference
{
PhotometryId = "photometry"
}
EmitterId = "emitter"
},
VariantDescriptiveAttributes = new DescriptiveAttributes
{
Expand All @@ -437,12 +439,9 @@ public class DescriptiveAttributesModel
{
new Locale { Language = "en", Text = "Variant 5" }
},
EmitterReferences = new EmitterReferences
Reference = new EmitterReference
{
Reference = new LightEmitterReference
{
PhotometryId = "photometry"
}
EmitterId = "emitter"
},
VariantDescriptiveAttributes = new DescriptiveAttributes
{
Expand All @@ -465,12 +464,9 @@ public class DescriptiveAttributesModel
{
new Locale { Language = "en", Text = "Variant 6" }
},
EmitterReferences = new EmitterReferences
Reference = new EmitterReference
{
Reference = new LightEmitterReference
{
PhotometryId = "photometry"
}
EmitterId = "emitter"
},
VariantDescriptiveAttributes = new DescriptiveAttributes
{
Expand All @@ -492,12 +488,9 @@ public class DescriptiveAttributesModel
{
new Locale { Language = "en", Text = "Variant 7" }
},
EmitterReferences = new EmitterReferences
Reference = new EmitterReference
{
Reference = new LightEmitterReference
{
PhotometryId = "photometry"
}
EmitterId = "emitter"
},
VariantDescriptiveAttributes = new DescriptiveAttributes
{
Expand Down
Loading

0 comments on commit 744ff7c

Please sign in to comment.