|
|
|
@ -59,23 +59,23 @@ namespace UnitTesting
|
|
|
|
|
{
|
|
|
|
|
CodeCompletException exception = new CodeCompletException();
|
|
|
|
|
|
|
|
|
|
#pragma warning disable SYSLIB0050
|
|
|
|
|
#pragma warning disable SYSLIB0050
|
|
|
|
|
SerializationInfo info = new SerializationInfo(typeof(CodeCompletException), new FormatterConverter());
|
|
|
|
|
StreamingContext contexte = new StreamingContext(StreamingContextStates.All);
|
|
|
|
|
#pragma warning restore SYSLIB0050
|
|
|
|
|
#pragma warning restore SYSLIB0050
|
|
|
|
|
|
|
|
|
|
#pragma warning disable SYSLIB0051
|
|
|
|
|
#pragma warning disable SYSLIB0051
|
|
|
|
|
exception.GetObjectData(info, contexte);
|
|
|
|
|
#pragma warning restore SYSLIB0051
|
|
|
|
|
#pragma warning restore SYSLIB0051
|
|
|
|
|
|
|
|
|
|
Assert.Equal(exception.Message, info.GetString("Message"));
|
|
|
|
|
|
|
|
|
|
#pragma warning disable SYSLIB0050
|
|
|
|
|
#pragma warning disable SYSLIB0050
|
|
|
|
|
CodeCompletException exceptionSerialisee =
|
|
|
|
|
(CodeCompletException) FormatterServices.GetUninitializedObject(typeof(CodeCompletException));
|
|
|
|
|
#pragma warning restore SYSLIB0050
|
|
|
|
|
#pragma warning restore SYSLIB0050
|
|
|
|
|
|
|
|
|
|
ConstructorInfo? constructeur = typeof(CodeCompletException).GetConstructor(BindingFlags.Instance | BindingFlags.NonPublic, null, new[] { typeof(SerializationInfo), typeof(StreamingContext) }, null);
|
|
|
|
|
ConstructorInfo? constructeur = typeof(CodeCompletException).GetConstructor(BindingFlags.Instance | BindingFlags.NonPublic, null, [typeof(SerializationInfo), typeof(StreamingContext)], null);
|
|
|
|
|
Assert.NotNull(constructeur);
|
|
|
|
|
constructeur.Invoke(exceptionSerialisee, [info, contexte]);
|
|
|
|
|
|
|
|
|
|