public Property InvalidBoundariesThrowAndValidOnesDoNot(BoundaryType boundaryType, T value) { var boundary = CreateBoundary(value, boundaryType); var valueResult = Result.From(() => boundary.Value); var typeResult = Result.From(() => boundary.Type); return(InvalidBoundaryValue.IsInvalidBoundaryValue <T, TComparer>(value) ? (valueResult.Exception is InvalidOperationException && typeResult.Exception is InvalidOperationException && !boundary.IsValid).ToProperty() : (valueResult.HasValue && typeResult.HasValue && boundary.IsValid).ToProperty()); }
public Property AllInvalidBoundariesAreEqual(InvalidBoundaryValue <T, TComparer> firstValue, BoundaryType firstBoundaryType, InvalidBoundaryValue <T, TComparer> secondValue, BoundaryType secondBoundaryType) => (firstValue.DoesExist && CreateBoundary(firstValue.Value, firstBoundaryType).Equals(CreateBoundary(secondValue.Value, secondBoundaryType))).Or(!firstValue.DoesExist);