File tree Expand file tree Collapse file tree
ManagedCode.Communication.Tests Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -40,18 +40,11 @@ public void AsResult_WithIntValue_CreatesSuccessfulResult()
4040 }
4141
4242 [ Test ]
43- public void AsResult_WithNullValue_CreatesSuccessfulResultWithNull ( )
43+ public void AsResult_WithNullValue_RejectsInvalidSuccess ( )
4444 {
45- // Arrange
4645 string ? value = null ;
4746
48- // Act
49- var result = value . AsResult ( ) ;
50-
51- // Assert
52- result . IsSuccess . ShouldBeTrue ( ) ;
53- result . Value . ShouldBeNull ( ) ;
54- result . Problem . ShouldBeNull ( ) ;
47+ Should . Throw < ArgumentNullException > ( ( ) => value . AsResult ( ) ) ;
5548 }
5649
5750 [ Test ]
Original file line number Diff line number Diff line change @@ -117,18 +117,16 @@ public async Task ResultT_WithComplexValue_ShouldSerializeCorrectly()
117117 }
118118
119119 [ Test ]
120- public async Task ResultT_WithNullValue_ShouldSerializeCorrectly ( )
120+ public async Task ResultT_WithNullFailureValue_ShouldSerializeCorrectly ( )
121121 {
122- // Arrange
123122 var grain = _grainFactory . GetGrain < ITestSerializationGrain > ( Guid . NewGuid ( ) ) ;
124- var result = Result < string ? > . Succeed ( ( string ? ) null ) ;
123+ var result = Result < string ? > . Fail ( ) ;
125124
126- // Act
127125 var echoed = await grain . EchoResultAsync ( result ) ;
128126
129- // Assert
130- echoed . IsSuccess . ShouldBeTrue ( ) ;
127+ echoed . IsFailed . ShouldBeTrue ( ) ;
131128 echoed . Value . ShouldBeNull ( ) ;
129+ echoed . Problem . ShouldNotBeNull ( ) ;
132130 }
133131
134132 [ Test ]
You can’t perform that action at this time.
0 commit comments