Skip to content

Commit f9bb2fc

Browse files
committed
fix(common,xml-tests): correct XSD minOccurs citation, sweep AmE spelling
IConfiguration.VendorExtensions' class remarks misquoted MTConnectDevices_2.7.xsd's ComponentConfigurationType content model as minOccurs="0" on the AbstractConfiguration ref; the schema (tests/Compliance/.../v2_7/MTConnectDevices_2.7.xsd:8168) declares minOccurs='1' — once <Configuration> is present it must contain at least one AbstractConfiguration-substitution child. Also sweeps the handful of BrE spellings ("unrecognised", "behaviour", "serialise(s/d)", "deserialiser") introduced by this PR's own commits into AmE, including two test method names, matching the repo-wide AmE convention already applied everywhere else in the codebase. Found by the code-review pass of the PR #223 dime review cycle.
1 parent 87de7c5 commit f9bb2fc

2 files changed

Lines changed: 19 additions & 19 deletions

File tree

libraries/MTConnect.NET-Common/Devices/Configurations/IConfiguration.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace MTConnect.Devices.Configurations
1212
/// itself defines vendor extension of a component's Configuration through the
1313
/// XSD substitution group <c>AbstractConfiguration</c> — see
1414
/// <c>MTConnectDevices_2.7.xsd</c> where <c>ComponentConfigurationType</c>
15-
/// declares <c>&lt;xs:element ref="AbstractConfiguration" minOccurs="0"
15+
/// declares <c>&lt;xs:element ref="AbstractConfiguration" minOccurs="1"
1616
/// maxOccurs="unbounded"/&gt;</c>, and every standard child (SensorConfiguration,
1717
/// Specifications, Relationships, CoordinateSystems, Motion, SolidModel,
1818
/// ImageFiles, PowerSources) is declared with
@@ -31,8 +31,8 @@ public partial interface IConfiguration
3131
/// element (see class-level remarks for the MTConnect XSD citation).
3232
/// The MTConnect.NET XML formatter writes each element verbatim inside
3333
/// the <c>&lt;Configuration&gt;</c> sequence, alongside any standard
34-
/// children present on this instance; the deserialiser captures any
35-
/// child element it does not recognise as a standard configuration
34+
/// children present on this instance; the deserializer captures any
35+
/// child element it does not recognize as a standard configuration
3636
/// child and adds it here. Strict XSD validation of the emitted
3737
/// document is the caller's responsibility and requires the vendor XSD
3838
/// to be loaded alongside the MTConnect schemas.

tests/MTConnect.NET-XML-Tests/Devices/Configurations/ConfigurationVendorExtensionsRoundTripTests.cs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ public class ConfigurationVendorExtensionsRoundTripTests
4343
{
4444
// ---------------- positive: emit ----------------
4545

46-
/// <summary>Pins the behaviour expressed by the test name: single vendor extension serialises inside configuration element.</summary>
46+
/// <summary>Pins the behavior expressed by the test name: single vendor extension serializes inside configuration element.</summary>
4747
[Test]
48-
public void Single_vendor_extension_serialises_inside_Configuration_element()
48+
public void Single_vendor_extension_serializes_inside_Configuration_element()
4949
{
5050
var configuration = new Configuration
5151
{
@@ -69,7 +69,7 @@ public void Single_vendor_extension_serialises_inside_Configuration_element()
6969
Assert.That(xml, Does.Contain("</mycorp:MyExtension>"));
7070
}
7171

72-
/// <summary>Pins the behaviour expressed by the test name: multiple vendor extensions preserve order.</summary>
72+
/// <summary>Pins the behavior expressed by the test name: multiple vendor extensions preserve order.</summary>
7373
[Test]
7474
public void Multiple_vendor_extensions_preserve_order()
7575
{
@@ -90,12 +90,12 @@ public void Multiple_vendor_extensions_preserve_order()
9090

9191
Assert.That(aIndex, Is.GreaterThanOrEqualTo(0), "First extension missing");
9292
Assert.That(bIndex, Is.GreaterThan(aIndex),
93-
"Second extension must serialise after the first to preserve author order");
93+
"Second extension must serialize after the first to preserve author order");
9494
}
9595

96-
/// <summary>Pins the behaviour expressed by the test name: vendor extensions serialise alongside standard children.</summary>
96+
/// <summary>Pins the behavior expressed by the test name: vendor extensions serialize alongside standard children.</summary>
9797
[Test]
98-
public void Vendor_extensions_serialise_alongside_standard_children()
98+
public void Vendor_extensions_serialize_alongside_standard_children()
9999
{
100100
var configuration = new Configuration
101101
{
@@ -121,9 +121,9 @@ public void Vendor_extensions_serialise_alongside_standard_children()
121121

122122
// ---------------- positive: capture on read ----------------
123123

124-
/// <summary>Pins the behaviour expressed by the test name: unrecognised child element is captured as vendor extension.</summary>
124+
/// <summary>Pins the behavior expressed by the test name: unrecognized child element is captured as vendor extension.</summary>
125125
[Test]
126-
public void Unrecognised_child_element_is_captured_as_VendorExtension()
126+
public void Unrecognized_child_element_is_captured_as_VendorExtension()
127127
{
128128
const string xml =
129129
"<Configuration xmlns:mycorp=\"urn:mycorp:mtconnect\">"
@@ -141,7 +141,7 @@ public void Unrecognised_child_element_is_captured_as_VendorExtension()
141141
Assert.That(extensions[0].Element("Payload")?.Value, Is.EqualTo("42"));
142142
}
143143

144-
/// <summary>Pins the behaviour expressed by the test name: full round trip preserves vendor extension content.</summary>
144+
/// <summary>Pins the behavior expressed by the test name: full round trip preserves vendor extension content.</summary>
145145
[Test]
146146
public void Full_round_trip_preserves_vendor_extension_content()
147147
{
@@ -176,7 +176,7 @@ public void Full_round_trip_preserves_vendor_extension_content()
176176
Assert.That(foo.Value, Is.EqualTo("child-text"));
177177
}
178178

179-
/// <summary>Pins the behaviour expressed by the test name: two vendor extensions round trip correctly.</summary>
179+
/// <summary>Pins the behavior expressed by the test name: two vendor extensions round trip correctly.</summary>
180180
[Test]
181181
public void Two_vendor_extensions_round_trip_correctly()
182182
{
@@ -205,7 +205,7 @@ public void Two_vendor_extensions_round_trip_correctly()
205205

206206
// ---------------- negative ----------------
207207

208-
/// <summary>Pins the behaviour expressed by the test name: null vendor extensions emits no extra child.</summary>
208+
/// <summary>Pins the behavior expressed by the test name: null vendor extensions emits no extra child.</summary>
209209
[Test]
210210
public void Null_VendorExtensions_emits_no_extra_child()
211211
{
@@ -225,7 +225,7 @@ public void Null_VendorExtensions_emits_no_extra_child()
225225
Is.EqualTo("<Configuration />").Or.EqualTo("<Configuration></Configuration>"));
226226
}
227227

228-
/// <summary>Pins the behaviour expressed by the test name: empty vendor extensions collection emits no extra child.</summary>
228+
/// <summary>Pins the behavior expressed by the test name: empty vendor extensions collection emits no extra child.</summary>
229229
[Test]
230230
public void Empty_VendorExtensions_collection_emits_no_extra_child()
231231
{
@@ -245,14 +245,14 @@ public void Empty_VendorExtensions_collection_emits_no_extra_child()
245245
Is.EqualTo("<Configuration />").Or.EqualTo("<Configuration></Configuration>"));
246246
}
247247

248-
/// <summary>Pins the behaviour expressed by the test name: configuration with only standard children has null vendor extensions on read.</summary>
248+
/// <summary>Pins the behavior expressed by the test name: configuration with only standard children has null vendor extensions on read.</summary>
249249
[Test]
250250
public void Configuration_with_only_standard_children_has_null_VendorExtensions_on_read()
251251
{
252252
// A Configuration whose children are all standard ones bound to
253253
// strongly-typed slots must NOT accidentally capture them into
254254
// VendorExtensions — the [XmlAnyElement] attribute only fires on
255-
// elements the deserialiser has not otherwise bound.
255+
// elements the deserializer has not otherwise bound.
256256
const string xml =
257257
"<Configuration>"
258258
+ "<Motion id=\"m1\" type=\"PRISMATIC\" actuation=\"DIRECT\">"
@@ -291,7 +291,7 @@ public void Write_skips_null_entries_in_VendorExtensions_collection()
291291
Assert.That(xml, Does.Contain("<a:First xmlns:a=\"urn:a\">one</a:First>"));
292292
Assert.That(xml, Does.Contain("<b:Second xmlns:b=\"urn:b\">two</b:Second>"));
293293
// Should be exactly two extension elements — the null slot is
294-
// skipped, not serialised as an empty tag.
294+
// skipped, not serialized as an empty tag.
295295
Assert.That(xml.Split("</a:First>").Length - 1, Is.EqualTo(1));
296296
Assert.That(xml.Split("</b:Second>").Length - 1, Is.EqualTo(1));
297297
}
@@ -428,7 +428,7 @@ public void Round_trip_preserves_nested_attributes_verbatim()
428428

429429
/// <summary>Two vendor extensions from distinct vendor namespaces
430430
/// round-trip independently — each keeps its own namespace binding,
431-
/// and the deserialiser distinguishes them by fully-qualified
431+
/// and the deserializer distinguishes them by fully-qualified
432432
/// <see cref="XName"/> rather than by local name alone.</summary>
433433
[Test]
434434
public void Round_trip_preserves_distinct_vendor_namespaces()

0 commit comments

Comments
 (0)