Skip to content

Commit 2a11581

Browse files
committed
Restored serialization for NET40
1 parent e3f6513 commit 2a11581

File tree

5 files changed

+49
-3
lines changed

5 files changed

+49
-3
lines changed

src/TestStack.BDDfy/Processors/InconclusiveException.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Runtime.Serialization;
23

34
namespace TestStack.BDDfy.Processors
45
{
@@ -15,5 +16,11 @@ public InconclusiveException(string message) : base(message)
1516
public InconclusiveException(string message, Exception innerException) : base(message, innerException)
1617
{
1718
}
19+
#if NET40
20+
21+
protected InconclusiveException(SerializationInfo info, StreamingContext context) : base(info, context)
22+
{
23+
}
24+
#endif
1825
}
1926
}
Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,23 @@
1-
namespace TestStack.BDDfy.Processors
2-
{
3-
using System;
1+
using System;
2+
using System.Runtime.Serialization;
43

4+
namespace TestStack.BDDfy.Processors
5+
{
6+
[Serializable]
57
public class UnusedExampleException : Exception
68
{
79
public UnusedExampleException(ExampleValue unusedValue) :
810
base(string.Format("Example Column '{0}' is unused, all examples should be consumed by the test (have you misspelt a field or property?)\r\n\r\n"
911
+ "If this is not the case, raise an issue at https://github.com/TestStack/TestStack.BDDfy/issues.", unusedValue.Header))
1012
{ }
13+
#if NET40
14+
15+
protected UnusedExampleException(
16+
SerializationInfo info,
17+
StreamingContext context)
18+
: base(info, context)
19+
{
20+
}
21+
#endif
1122
}
1223
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,24 @@
11
using System;
2+
using System.Runtime.Serialization;
23

34
namespace TestStack.BDDfy
45
{
6+
[Serializable]
57
public class UnassignableExampleException : Exception
68
{
79
public UnassignableExampleException(string message, Exception inner, ExampleValue exampleValue) : base(message, inner)
810
{
911
ExampleValue = exampleValue;
1012
}
13+
#if NET40
1114

15+
protected UnassignableExampleException(
16+
SerializationInfo info,
17+
StreamingContext context) : base(info, context)
18+
{
19+
}
20+
21+
#endif
1222
public ExampleValue ExampleValue { get; private set; }
1323
}
1424
}

src/TestStack.BDDfy/Scanners/StepScanners/StepTitleException.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Runtime.Serialization;
23

34
namespace TestStack.BDDfy
45
{
@@ -15,5 +16,12 @@ public StepTitleException(string message) : base(message)
1516
public StepTitleException(string message, Exception innerException) : base(message, innerException)
1617
{
1718
}
19+
#if NET40
20+
21+
protected StepTitleException(SerializationInfo info, StreamingContext context)
22+
: base(info, context)
23+
{
24+
}
25+
#endif
1826
}
1927
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#if NET40
2+
3+
#else
4+
namespace System.Runtime.Serialization
5+
{
6+
public class SerializableAttribute : Attribute
7+
{
8+
}
9+
}
10+
#endif

0 commit comments

Comments
 (0)