public void Verify_That_WriteXml_Without_Definition_Set_Throws_SerializationException() { using var memoryStream = new MemoryStream(); using var writer = XmlWriter.Create(memoryStream, new XmlWriterSettings { Indent = true }); var attributeValueReal = new AttributeValueReal(); Assert.That(() => attributeValueReal.WriteXml(writer), Throws.Exception.TypeOf <SerializationException>()); }
public void VerifyThatWriteXmlWithoutDefinitionSetThrowsSerializationException() { using (var fs = new FileStream("test.xml", FileMode.Create)) { using (var writer = XmlWriter.Create(fs, new XmlWriterSettings { Indent = true })) { var attributeValueReal = new AttributeValueReal(); Assert.Throws <SerializationException>(() => attributeValueReal.WriteXml(writer)); } } }