예제 #1
0
        public void ConvertTo_NewValue_ReturnNewFailureResultPresservingProperties()
        {
            // Arrange:
            var result = new FailureResult <int>
            {
                ErrorTitle       = "Custom Title",
                ErrorDescription = "Custom Description",
            };

            // Act:
            var newResult = result.ConvertTo <double>();

            // Assert:
            var failureResult = newResult.Should().BeOfType <FailureResult <double> >().Subject;

            failureResult.Should().NotBeSameAs(result);
            failureResult.Should().BeEquivalentTo(result);
        }