File tree 2 files changed +22
-0
lines changed
2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change 1
1
using System ;
2
+ using System . Diagnostics . CodeAnalysis ;
2
3
3
4
namespace DiffLib ;
4
5
5
6
/// <summary>
6
7
/// This class is used to specify options to the diff algorithm.
7
8
/// </summary>
9
+ [ ExcludeFromCodeCoverage ]
8
10
public record struct DiffOptions ( )
9
11
{
10
12
private readonly int _ContextSize = 1 ;
Original file line number Diff line number Diff line change @@ -291,4 +291,24 @@ public void ToString_OfDefaultOption_ReturnsEmptyString()
291
291
292
292
Assert . That ( s , Is . SameAs ( string . Empty ) ) ;
293
293
}
294
+
295
+ [ Test ]
296
+ public void GetValueOrDefault_WithValue_ReturnsValue ( )
297
+ {
298
+ var o = new Option < int > ( 10 ) ;
299
+
300
+ int output = o . GetValueOrDefault ( ) ;
301
+
302
+ Assert . That ( output , Is . EqualTo ( 10 ) ) ;
303
+ }
304
+
305
+ [ Test ]
306
+ public void GetValueOrDefault_WithoutValue_ReturnsDefault ( )
307
+ {
308
+ var o = default ( Option < int > ) ;
309
+
310
+ int output = o . GetValueOrDefault ( ) ;
311
+
312
+ Assert . That ( output , Is . EqualTo ( 0 ) ) ;
313
+ }
294
314
}
You can’t perform that action at this time.
0 commit comments