public void Test202() { using var htmlParser = new HtmlParser(); var elmRef = new ElementReference(Guid.NewGuid().ToString()); var elm = (IElement)htmlParser.Parse($"<p {Htmlizer.ELEMENT_REFERENCE_ATTR_NAME}=\"ASDF\" />").First(); Should.Throw <ActualExpectedAssertException>(() => elmRef.ShouldBeElementReferenceTo(elm)); var elmWithoutRefAttr = (IElement)htmlParser.Parse($"<p />").First(); Should.Throw <ActualExpectedAssertException>(() => elmRef.ShouldBeElementReferenceTo(elmWithoutRefAttr)); }