@@ -62,6 +62,25 @@ protected Result<K, E> GetResult_K_E_WithParam(T value)
6262 protected Task < Result < K , E > > GetResult_K_E_WithParam_Task ( T value )
6363 => GetResult_K_E_WithParam ( value ) . AsTask ( ) ;
6464
65+ protected Result < T , E > GetResult_T_E ( )
66+ {
67+ funcExecuted = true ;
68+ return Result . Success < T , E > ( T . Value ) ;
69+ }
70+
71+ protected Task < Result < T , E > > GetResult_T_E_Task ( )
72+ => GetResult_T_E ( ) . AsTask ( ) ;
73+
74+ protected UnitResult < E > GetUnitResult_E_WithParam ( T value )
75+ {
76+ funcExecuted = true ;
77+ funcParam = value ;
78+ return UnitResult . Success < E > ( ) ;
79+ }
80+
81+ protected Task < UnitResult < E > > GetUnitResult_E_WithParam_Task ( T value )
82+ => GetUnitResult_E_WithParam ( value ) . AsTask ( ) ;
83+
6584 protected void AssertFailure ( Result output )
6685 {
6786 funcExecuted . Should ( ) . BeFalse ( ) ;
@@ -83,6 +102,13 @@ protected void AssertFailure(Result<K, E> output)
83102 output . Error . Should ( ) . Be ( E . Value ) ;
84103 }
85104
105+ protected void AssertFailure ( UnitResult < E > output )
106+ {
107+ funcExecuted . Should ( ) . BeFalse ( ) ;
108+ output . IsFailure . Should ( ) . BeTrue ( ) ;
109+ output . Error . Should ( ) . Be ( E . Value ) ;
110+ }
111+
86112 protected void AssertSuccess ( Result output )
87113 {
88114 funcExecuted . Should ( ) . BeTrue ( ) ;
@@ -102,5 +128,11 @@ protected void AssertSuccess(Result<K, E> output)
102128 output . IsSuccess . Should ( ) . BeTrue ( ) ;
103129 output . Value . Should ( ) . Be ( K . Value ) ;
104130 }
131+
132+ protected void AssertSuccess ( UnitResult < E > output )
133+ {
134+ funcExecuted . Should ( ) . BeTrue ( ) ;
135+ output . IsSuccess . Should ( ) . BeTrue ( ) ;
136+ }
105137 }
106138}
0 commit comments