Skip to content

Commit d0de45c

Browse files
authored
Merge pull request #9 from ehonda/feature/improve-tests
Add test case for implicit conversion from `null` to `NullableOption<T>`
2 parents 43b503c + 174df0d commit d0de45c

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tests/Core.Tests/NullableOptionTests.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,24 @@ public async Task Implicit_Conversion_From_Null_Should_Create_Some_Null()
113113
await Assert.That(option.Value).IsNull();
114114
}
115115

116+
[Test]
117+
public async Task Implicit_Conversion_From_Null_Nullable_Int_Should_Create_Some_Null()
118+
{
119+
NullableOption<int?> option = null;
120+
121+
await Assert.That(option.HasValue).IsTrue();
122+
await Assert.That(option.Value).IsNull();
123+
}
124+
125+
[Test]
126+
public async Task Implicit_Conversion_From_Null_Nullable_String_Should_Create_Some_Null()
127+
{
128+
NullableOption<string> option = null;
129+
130+
await Assert.That(option.HasValue).IsTrue();
131+
await Assert.That(option.Value).IsNull();
132+
}
133+
116134
[Test]
117135
public async Task Implicit_Conversion_From_Option_Should_Work()
118136
{

0 commit comments

Comments
 (0)