当Logic应用程序触发器是Http Request时,如何使用SpecFlow测试逻辑应用程序?

时间:2018-01-11 17:23:19

标签: c# azure specflow azure-logic-apps

我有Dim rsParent As DAO.Recordset Dim rsAttachment As DAO.Recordset2 Dim strFileName As String Dim SQL As String Dim fDialog As Office.FileDialog Dim varFile As Variant Set fDialog = Application.FileDialog(msoFileDialogFilePicker) With fDialog .Title = "Choose the document to add to the form..." .AllowMultiSelect = False .InitialFileName = "C:\Users\" If .Show = True Then If .SelectedItems.Count = 0 Then GoTo SubExit End If '' For Each varFile In .SelectedItems strFileName = varFile Next Else GoTo SubExit End If End With SQL = "SELECT * FROM tblTable WHERE RecordID = " & Me.tbxRecordID 'Instantiate the parent recordset Set rsParent = CurrentDb.OpenRecordset(SQL, dbOpenDynaset) '' If rsParent.recordCount = 0 Then MsgBox "There was a problem locating the selected record", vbCritical + vbOKOnly, "Error" GoTo SubExit Else ' Put recordset in edit mode rsParent.Edit 'Set the child recordset Set rsAttachment = rsParent.Fields("Document").Value '**Runtime 3709 - Search key not found** 'Add new attachment rsAttachment.AddNew rsAttachment.Fields("FileData").LoadFromFile strFileName rsAttachment.Update rsParent.Update frmAttachments.Requery End If SubExit: On Error Resume Next If Not rsParent Is Nothing Then rsParent.Close Set rsParent = Nothing End If Exit Sub ' SubError: MsgBox "Error Number: " & Err.Number & " = " & Err.Description, vbCritical + vbOKOnly, _ "An error occurred" GoTo SubExit ' End Sub 这篇文章Michael Stephenson already gone through

我的automated-testing-logic-apps-specflow我想知道如何使用Logicapp triggers with Http Request库编写测试用例。

我尝试了以下几个步骤但是如何触发它的第一步呢?

SpecFLow

enter image description here

1 个答案:

答案 0 :(得分:1)

您必须使用C#中的辅助类来实现HTTP调用逻辑应用程序URL的逻辑,如同Michael Stephenson的文章在队列中发布新消息一样。