我有一个测试滑动窗口的测试:
df[rowSums(sapply(df, function(x) x %in% letters)) > 0,]
#OR
df[apply(df == sapply(df, tolower), 1, any),]
# v1 v2 v3 v4 v5
#1 B L L M e
#9 R N D t t
#10 F X M h x
我需要测试滑动窗口在一步之后产生正确的输出。 我做了这样的事情:
Private Sub UserForm_Initialize()
Dim i As Integer
For i = 1 To 2
Me.Controls("options" & CStr(i)).AddItem "Option 1"
Me.Controls("options" & CStr(i)).AddItem "Option 2"
Me.Controls("nights" & CStr(i)).AddItem "1"
Me.Controls("nights" & CStr(i)).AddItem "2"
Next i
End Sub
Private Sub btnEnd_Click()
Dim options(1 To 2) As String
Dim nights(1 To 2) As Integer
For i = 1 To 2
ThisWorkbook.Sheets("Sheet1").Cells(2, i + 1) = options(i)
ThisWorkbook.Sheets("Sheet1").Cells(3, i + 1) = nights(i)
Next i
End Sub
第一个循环应在第一个时间窗口内产生结果,并且在滑动1分钟后,第二个循环应产生第二个记录,并带有第二个窗口的结果(滑动后) 我该如何检查?我不完全了解如何使用输出读取器来检查这两个结果。
答案 0 :(得分:1)
每当期望输出可用时,您都将致电testDriver.readOutput()
。当然,您需要将结果写入输出主题,例如
...
.suppress(Suppressed.untilWindowCloses(unbounded()))
.toStream()
.to("output-topic");