public void GetObjectData_of_generic_result_adds_object_in_context_when_success_result()
        {
            SerializationTestObject language = new SerializationTestObject {
                Number = 232, String = "C#"
            };
            Result <SerializationTestObject> okResult = Result.Ok(language);
            ISerializable serializableObject          = okResult;

            var serializationInfo = new SerializationInfo(typeof(Result), new FormatterConverter());

            serializableObject.GetObjectData(serializationInfo, new StreamingContext());

            serializationInfo.GetValue(nameof(Result <SerializationTestObject> .Value), typeof(SerializationTestObject))
            .Should().Be(language);
        }
        public void BinarySerialization_generic_gives_back_a_resembling_failure_result()
        {
            SerializationTestObject language = new SerializationTestObject {
                Number = 232, String = "C#"
            };
            Result <SerializationTestObject> okResult = Result.Fail <SerializationTestObject>(_errorMessage);

            using (MemoryStream stream = SerializeToStream(okResult))
            {
                var actual = (Result <SerializationTestObject>)DeserializeFromStream(stream);

                actual.IsSuccess.Should().BeFalse();
                actual.IsFailure.Should().BeTrue();
                actual.Error.Single().ShouldBeEquivalentTo(new ValidationError(_errorMessage));
            }
        }