public void FieldValidationErrorShouldBe(string fieldName, string errorMsg) { var exceptionResponseMsg = _transportMock.TpQueue.GetMessages <PluginCommandResponseMessage>().Single( x => x.PluginCommandStatus == PluginCommandStatus.Fail); var errorCollection = exceptionResponseMsg.ResponseData.Deserialize <PluginProfileErrorCollection>(); var fieldValidationError = errorCollection.Where(x => x.FieldName == fieldName); new[] { errorMsg }.Should(Be.SubsetOf(fieldValidationError.Select(x => x.Message).ToArray())); }
public void ErrorShouldOccur(string fieldName, string errorMessage) { var errors = GetSuccessfullResponse().ResponseData.Deserialize <PluginProfileErrorCollection>(); new[] { errorMessage }.Should(Be.SubsetOf(errors.Where(x => x.FieldName == fieldName).Select(x => x.Message).ToList())); }