public void ConditionalServiceResult_IsFailure_IfConditionSuccessful() { var result = new ConditionalServiceResult <string, ServiceResult <string> >( ServiceResult.FromResult("test"), ServiceResult.FromError("Failure")); result.ShouldBeFailure(); }
public void ConditionalServiceResult_HasResult_IfProvided() { var result = new ConditionalServiceResult <string, ServiceResult <string> >( ServiceResult.FromResult("test"), ServiceResult.FromSuccess()); result.Result.ShouldBe("test"); }
public void ConditionalServiceResult_IsSuccessful_IfConditionSuccessful() { var result = new ConditionalServiceResult <string, ServiceResult <string> >( ServiceResult.FromResult("test"), ServiceResult.FromSuccess()); result.ShouldBeSuccessful(); }
public void ResultFormatManager_ReturnsSpecializedFormatter_ForFailedConditionalResult() { var derivedResult = new DerivedServiceResult(false); var conditional = new ConditionalServiceResult <string, ServiceResult <string> > (ServiceResult.FromResult(""), derivedResult); var result = ResultFormatManager.Format <ServiceResult, string>(conditional); result.ShouldStartWith(DerivedResultFormatter.Value); }