Ejemplo n.º 1
0
        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));
        }
Ejemplo n.º 2
0
 public EventData ToEvent(Message.IObservation message)
 {
     return(new EventData(Guid.NewGuid(), "Observation", true, ToBody(message), null));
 }