Пример #1
0
        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));
        }
Пример #2
0
        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));
        }
Пример #3
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));
        }