Beispiel #1
0
            internal void Cannot_handle_expression_bodied_property(TypeWithExpressionBodiedProperty source, int newValue)
            {
                // Act
                Action act = () => source.With(a => a.ExpressionBodiedProperty, newValue);

                // Assert
                act.Should().Throw <Exception>(because: "an expression-bodied property cannot be written to");
            }
Beispiel #2
0
            internal void Can_handle_expression_bodied_property(TypeWithExpressionBodiedProperty source, int newValue)
            {
                // Act
                var result = source.With(a => a.Age, newValue);

                // Assert
                result.Should().NotBeNull();
                result.Age.Should().Be(newValue);
            }