snatch-dev / Pactify

Contract testing tool for .NET Core.
MIT License
52 stars 10 forks source link

GetErrorMessage formatting error for body error message. #22

Open jnormen opened 1 year ago

jnormen commented 1 year ago

There is a bug in: GetErrorMessage when it verify body. It expect 3 parameters for the error message. PropertyName Value Expected value but only two params exist in the code and gives a formatter error.

This will work: (added propertyName in the array.)

file: HttpInteractionVerifier line: 114?

                   var propertyHasExpectedValue = providedProperty.Equals(propertyValue);

                    if (!propertyHasExpectedValue)
                    {
                        var message = GetErrorMessage(ErrorMessages.IncorrectReposnseBodyPropertyValue, propertyName,
                            propertyValue, providedProperty);
                        errors.Add(message);
                    }

I do not know how to contribute to the code it self for a review. Hope this lib is still active. Like this methods better then the RUST version.