Skip to content

Commit a4d2c9c

Browse files
[Improve] code coverage
1 parent dfefdc7 commit a4d2c9c

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

ReqIFSharp.Tests/SpecElementWithAttributesTests/SpecHierarchyTestFixture.cs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,5 +327,29 @@ public async Task ReadXmlAsync_UnsupportedElement_EmitsLogWarning()
327327
Assert.That(warningEvent.Properties["LocalName"].ToString().Trim('"'),
328328
Is.EqualTo("UNSUPPORTED-ELEMENT"));
329329
}
330+
331+
[Test]
332+
public void Verify_that_when_is_editable_is_not_boolean_exception_is_raised()
333+
{
334+
var content = new ReqIFContent();
335+
var rootSpecification = new Specification(content, null) { Identifier = "root" };
336+
337+
var specHierarchy = new SpecHierarchy(rootSpecification, content, null)
338+
{
339+
Identifier = "hierarchy"
340+
};
341+
342+
var xml = """
343+
<SPEC-HIERARCHY IDENTIFIER="hierarchy" IS-EDITABLE="INCORRECT-DATA-TYPE">
344+
<OBJECT />
345+
<CHILDREN />
346+
</SPEC-HIERARCHY>
347+
""";
348+
349+
using var reader = XmlReader.Create(new StringReader(xml), new XmlReaderSettings { Async = false });
350+
reader.MoveToContent();
351+
352+
Assert.That(() => specHierarchy.ReadXml(reader), Throws.InstanceOf<SerializationException>());
353+
}
330354
}
331355
}

0 commit comments

Comments
 (0)