public void ShouldBeAbleToMapIdentity() { State.Event.Mapper subject = new State.Event.Mapper(); var identity = subject.Map <With.Component.IIdentity, State.Component.Identity>(Identity); Assert.IsNotNull(identity); Assert.AreEqual(Identity.ToString(), identity.Value); }
public void ShouldBeAbleToMapMeasurement() { State.Event.Mapper subject = new State.Event.Mapper(); var measurement = subject.Map <With.Component.IMeasurement, State.Component.Measurement>(Measurement); Assert.IsNotNull(measurement); Assert.AreEqual(Measurement.Type, measurement.Type); Assert.AreEqual(Measurement.Value, measurement.Value); }
public void ShouldBeAbleToMapParameter() { State.Event.Mapper subject = new State.Event.Mapper(); var parameter = subject.Map <With.Component.IParameter, State.Component.Parameter>(Parameter); Assert.IsNotNull(parameter); Assert.IsNotNull(parameter.Identity); Assert.IsNotNull(parameter.Description); }
public void ShouldBeAbleToMapObservable() { State.Event.Mapper subject = new State.Event.Mapper(); var observable = subject.Map <With.Component.IObservable, State.Component.Observable>(Observable); Assert.IsNotNull(observable); Assert.IsNotNull(observable.Identity); Assert.IsNotNull(observable.Description); }
public void ShouldBeAbleToMapActionable() { State.Event.Mapper subject = new State.Event.Mapper(); var actionable = subject.Map <With.Component.IActionable, State.Component.Actionable>(Actionable); Assert.IsNotNull(actionable); Assert.IsNotNull(actionable.Identity); Assert.IsNotNull(actionable.Description); Assert.IsNotNull(actionable.Parameters); Assert.AreEqual(1, actionable.Parameters.Count()); }
public void ShouldBeAbleToMapDeregistrationMessage() { With.Message.IDeregister deregistration = A.Fake <With.Message.IDeregister>(); A.CallTo(() => deregistration.Registrar).Returns(Identity); A.CallTo(() => deregistration.Entity).Returns(Identity); State.Event.Mapper subject = new State.Event.Mapper(); State.Event.Deregistered actual = subject.Map(deregistration); Assert.AreEqual(deregistration.Registrar.ToString(), actual.Registrar.Value); Assert.AreEqual(deregistration.Entity.ToString(), actual.Entity.Value); }
public void ShouldBeAbleToMapEntity() { State.Event.Mapper subject = new State.Event.Mapper(); var entity = subject.Map <With.Component.IEntity, State.Component.Entity>(Entity); Assert.IsNotNull(entity); Assert.IsNotNull(entity.Identity); Assert.IsNotNull(entity.Description); Assert.IsNotNull(entity.Observables); Assert.AreEqual(1, entity.Observables.Count()); Assert.AreEqual(1, entity.Actionables.Count()); }
public void ShouldBeAbleToMapEntityDescription() { State.Event.Mapper subject = new State.Event.Mapper(); var entityDescription = subject.Map <With.Component.IEntityDescription, State.Component.EntityDescription>(EntityDescription); Assert.IsNotNull(entityDescription); Assert.AreEqual(EntityDescription.Name, entityDescription.Name); Assert.AreEqual(EntityDescription.Remarks, entityDescription.Remarks); Assert.AreEqual(EntityDescription.Type, entityDescription.Type); Assert.AreEqual(EntityDescription.Manufacturer, entityDescription.Manufacturer); Assert.AreEqual(EntityDescription.Model, entityDescription.Model); }
public void ShouldBeAbleToMapValueDescription() { State.Event.Mapper subject = new State.Event.Mapper(); var description = subject.Map <With.Component.IValueDescription, State.Component.ValueDescription>(ValueDescription); Assert.IsNotNull(description); Assert.AreEqual(ValueDescription.Name, description.Name); Assert.AreEqual(ValueDescription.Remarks, description.Remarks); Assert.IsNotNull(description.Measurement); Assert.IsNotNull(description.Default); Assert.IsNotNull(description.Minimum); Assert.IsNotNull(description.Maximum); }
public void ShouldBeAbleToMapObservationMessage() { DateTimeOffset date = new DateTimeOffset(2014, 04, 06, 10, 20, 00, TimeSpan.Zero); With.Message.IObservation observation = A.Fake <With.Message.IObservation>(); A.CallTo(() => observation.Entity).Returns(Identity); A.CallTo(() => observation.Observable).Returns(Identity); A.CallTo(() => observation.Date).Returns(date); A.CallTo(() => observation.Measurement).Returns(Measurement); State.Event.Mapper subject = new State.Event.Mapper(); State.Event.Observed actual = subject.Map(observation); Assert.AreEqual(observation.Entity.ToString(), actual.Entity.Value); Assert.AreEqual(observation.Observable.ToString(), actual.Observable.Value); Assert.AreEqual(observation.Date, actual.Date); Assert.IsNotNull(actual.Measurement); }