Beispiel #1
0
            public void ShouldThrowException_WhenPropertyDoesNotExist()
            {
                // Arrange
                var value     = new ComplexTestClass();
                var immutable = new Immutable <ComplexTestClass>(value);

                // Act
                Action result = () => immutable.Ref("Thing");

                // Assert
                result.Should().Throw <ArgumentException>().WithMessage("Property 'Thing' does not exist on this object.");
            }
Beispiel #2
0
            public void ShouldReturnImmutable_WhenPropertyExists()
            {
                // Arrange
                var value     = new ComplexTestClass();
                var immutable = new Immutable <ComplexTestClass>(value);

                // Act
                var result = immutable.Ref("Things");

                // Assert
                result.Should().BeOfType <Immutable <SimpleTestClass> >();
            }