public void Should_throw_if_no_message_property_found_for_conventional_substract() { // Arrange var builder = new AddNewProjectionStrategyArguments <TestMessage, TestProjection>(); // Act var @delegate = new TestDelegate(() => builder.Substract(p => p.NoMessageProperty)); // Assert Assert.Throws <ArgumentOutOfRangeException>(@delegate); }
public void Should_substract_using_only_projection_property_name() { // Arrange var message = new TestMessage { MappedByName = 5 }; var projection = new TestProjection { MappedByName = 15 }; var builder = new AddNewProjectionStrategyArguments <TestMessage, TestProjection>(); builder.Substract(p => p.MappedByName); // Act builder.Mappers.Map(message, projection); // Assert Assert.AreEqual(10, projection.MappedByName); }
public void Should_substract_from_projection() { // Arrange var message = new TestMessage { MessageProperty = 5 }; var projection = new TestProjection { ProjectionProperty = 15 }; var builder = new AddNewProjectionStrategyArguments <TestMessage, TestProjection>(); builder.Substract(p => p.ProjectionProperty, e => e.MessageProperty); // Act builder.Mappers.Map(message, projection); // Assert Assert.AreEqual(10, projection.ProjectionProperty); }
public void Should_throw_if_no_message_property_found_for_conventional_substract() { // Arrange var builder = new AddNewProjectionStrategyArguments<TestMessage, TestProjection>(); // Act var @delegate = new TestDelegate(() => builder.Substract(p => p.NoMessageProperty)); // Assert Assert.Throws<ArgumentOutOfRangeException>(@delegate); }
public void Should_substract_using_only_projection_property_name() { // Arrange var message = new TestMessage {MappedByName = 5}; var projection = new TestProjection {MappedByName = 15}; var builder = new AddNewProjectionStrategyArguments<TestMessage, TestProjection>(); builder.Substract(p => p.MappedByName); // Act builder.Mappers.Map(message, projection); // Assert Assert.AreEqual(10, projection.MappedByName); }
public void Should_substract_from_projection() { // Arrange var message = new TestMessage {MessageProperty = 5}; var projection = new TestProjection {ProjectionProperty = 15}; var builder = new AddNewProjectionStrategyArguments<TestMessage, TestProjection>(); builder.Substract(p => p.ProjectionProperty, e => e.MessageProperty); // Act builder.Mappers.Map(message, projection); // Assert Assert.AreEqual(10, projection.ProjectionProperty); }