public void CanMapDeregisterFromMessageToSchema() { Message.IDeregister message = A.Fake <Message.IDeregister>(); A.CallTo(() => message.Registrar).Returns(A.Fake <Component.IIdentity>()); A.CallTo(() => message.Entity).Returns(A.Fake <Component.IIdentity>()); Hml.Schema.Message schema = _subject.ToSchema(message); Assert.IsNotNull(schema); Assert.IsInstanceOfType(schema, typeof(Hml.Schema.Deregister)); }
public void CanMapActFromMessageToSchema() { Message.IAction message = A.Fake <Message.IAction>(); A.CallTo(() => message.Entity).Returns(A.Fake <Component.IIdentity>()); A.CallTo(() => message.Actionable).Returns(A.Fake <Component.IIdentity>()); A.CallTo(() => message.Actor).Returns(A.Fake <Component.IIdentity>()); Hml.Schema.Message schema = _subject.ToSchema(message); Assert.IsNotNull(schema); Assert.IsInstanceOfType(schema, typeof(Hml.Schema.Action)); }
public void CanMapObservationFromMessageToSchema() { Message.IObservation message = A.Fake <Message.IObservation>(); A.CallTo(() => message.Entity).Returns(A.Fake <Component.IIdentity>()); A.CallTo(() => message.Observable).Returns(A.Fake <Component.IIdentity>()); A.CallTo(() => message.Date).Returns(DateTimeOffset.Now); A.CallTo(() => message.Measurement).Returns(A.Fake <Component.IMeasurement>()); Hml.Schema.Message schema = _subject.ToSchema(message); Assert.IsNotNull(schema); Assert.IsInstanceOfType(schema, typeof(Hml.Schema.Observation)); }