public void ShouldBeAbleToDynamicallyMapObservationToDto() { With.Message.IMessage source = new Message.Observation( new With.Component.Identity("TESTENTITY"), new With.Component.Identity("TESTOBSERVABLE"), DateTimeOffset.Now, new With.Component.Measurement( With.Component.MeasurementType.Units, "3.14" ) ); SignalR.Common.Dto.Message actual = source.AsDynamicDto(); Assert.IsInstanceOfType(actual, typeof(SignalR.Common.Dto.Observation)); }
public void ShouldBeAbleToMapObservationToDto() { With.Message.Observation source = new Message.Observation( new With.Component.Identity("TESTENTITY"), new With.Component.Identity("TESTOBSERVABLE"), DateTimeOffset.Now, new With.Component.Measurement( With.Component.MeasurementType.Units, "3.14" ) ); SignalR.Common.Dto.Observation actual = source.AsDto(); Assert.AreEqual(actual.Entity.Value, source.Entity.Value); Assert.AreEqual(actual.Observable.Value, source.Observable.Value); Assert.AreEqual(actual.Date, source.Date); Assert.AreEqual(actual.Measurement.Value, source.Measurement.Value); Assert.AreEqual(actual.Measurement.Type.ToString(), source.Measurement.Type.ToString()); }