public void ConcatErrors_OkStatus_EmptyList() { string valueInitial = "OK"; var resultValueInitial = new ResultValue <string>(valueInitial); var errorsToConcat = Enumerable.Empty <IErrorResult>(); var resultValueConcatted = resultValueInitial.ConcatErrors(errorsToConcat); Assert.True(resultValueConcatted.OkStatus); Assert.Equal(valueInitial, resultValueConcatted.Value); }
public void ConcatErrors_TotalOne() { var resultValueInitial = new ResultValue <string>("OK"); var errorToConcat = CreateErrorTest(); var resultValueConcatted = resultValueInitial.ConcatErrors(errorToConcat); Assert.True(resultValueConcatted.HasErrors); Assert.Single(resultValueConcatted.Errors); Assert.True(errorToConcat.Equals(resultValueConcatted.Errors.Last())); }
public void ConcatErrors_TotalTwo() { var initialError = CreateErrorTest(); var resultValueInitial = new ResultValue <string>(initialError); var errorToConcat = CreateErrorTest(); var resultValueConcatted = resultValueInitial.ConcatErrors(errorToConcat); Assert.True(resultValueConcatted.HasErrors); Assert.Equal(2, resultValueConcatted.Errors.Count); Assert.True(initialError.Equals(resultValueConcatted.Errors.First())); Assert.True(errorToConcat.Equals(resultValueConcatted.Errors.Last())); }