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 attributeValueString = new AttributeValueString(); Assert.That(() => attributeValueString.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 attributeValueString = new AttributeValueString(); Assert.Throws <SerializationException>(() => attributeValueString.WriteXml(writer)); } } }