Assembly: Gallio (in Gallio.dll) Version: 3.3.0.0 (3.3.459.0)
Syntax
| C# |
|---|
[SerializableAttribute] public class Message : IValidatable, INormalizable<Message> |
| Visual Basic (Declaration) |
|---|
<SerializableAttribute> _ Public Class Message _ Implements IValidatable, INormalizable(Of Message) |
Remarks
Subclasses of this type should be declared to be both XML-serializable (using XmlRootAttribute and XmlTypeAttribute) and binary serializable (using SerializableAttribute). They should also override Validate()()() to validate all message properties. Validation is performed before sending and after receiving messages to enforce basic message integrity constraints that are not checked by the serialization protocol itself.
Message types do not need to be declared in advanced. Consequently plugins may defined their own custom message types as long as they have a distinct name.
Examples
This is an example of a message type.
[Serializable] [XmlRoot("submitOrderMessage", Namespace = "http://www.fabrikam.org/messages")] [XmlType(Namespace = "http://www.fabrikam.org/messages")] public sealed class SubmitOrderMessage : Message { [XmlAttribute("item")] public string Item { get; set; } [XmlAttribute("quantity")] public int Quantity { get; set; } public override void Validate() { ValidationUtils.ValidateNotNull(Item); if (Quantity < 1 || Quantity > 10000) throw new ValidationException("Quantity should be between 1 and 10000."); } }
Inheritance Hierarchy
Gallio.Common.Messaging..::.Message
Gallio.Model.Isolation.Messages..::.IsolatedTaskFinishedMessage
Gallio.Model.Isolation.Messages..::.RunIsolatedTaskMessage
Gallio.Model.Isolation.Messages..::.ShutdownMessage
Gallio.Model.Messages.Execution..::.TestStepFinishedMessage
Gallio.Model.Messages.Execution..::.TestStepLifecyclePhaseChangedMessage
Gallio.Model.Messages.Execution..::.TestStepLogAttachMessage
Gallio.Model.Messages.Execution..::.TestStepLogStreamBeginMarkerBlockMessage
Gallio.Model.Messages.Execution..::.TestStepLogStreamBeginSectionBlockMessage
Gallio.Model.Messages.Execution..::.TestStepLogStreamEmbedMessage
Gallio.Model.Messages.Execution..::.TestStepLogStreamEndBlockMessage
Gallio.Model.Messages.Execution..::.TestStepLogStreamWriteMessage
Gallio.Model.Messages.Execution..::.TestStepMetadataAddedMessage
Gallio.Model.Messages.Execution..::.TestStepStartedMessage
Gallio.Model.Messages.Exploration..::.AnnotationDiscoveredMessage
Gallio.Model.Messages.Exploration..::.TestDiscoveredMessage
Gallio.Model.Messages.Logging..::.LogEntrySubmittedMessage
