Skip to content

Commit 2ab4d27

Browse files
committed
Add integration tests for previously failing scenarios
1 parent 654a95c commit 2ab4d27

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

RubberduckTests/IntegrationTests/FakeTests.bas

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -729,3 +729,48 @@ TestExit:
729729
TestFail:
730730
Assert.Fail "Test raised an error: #" & Err.Number & " - " & Err.Description
731731
End Sub
732+
733+
'@TestMethod
734+
Public Sub TestIssue4476()
735+
On Error GoTo TestFail
736+
737+
'Arrange:
738+
Fakes.Now.PassThrough = True
739+
Fakes.Date.PassThrough = True
740+
741+
'Act:
742+
Debug.Print Now
743+
Debug.Print Date '<== KA-BOOOM
744+
745+
'Assert:
746+
Fakes.Now.Verify.AtLeastOnce
747+
Fakes.Date.Verify.AtLeastOnce
748+
749+
TestExit:
750+
Exit Sub
751+
TestFail:
752+
Assert.Fail "Test raised an error: #" & Err.Number & " - " & Err.Description
753+
End Sub
754+
755+
'@TestMethod
756+
Public Sub TestIssue5944()
757+
On Error GoTo TestFail
758+
759+
Fakes.InputBox.Returns 20
760+
Fakes.MsgBox.Returns 20
761+
762+
Dim inputBoxReturnValue As String
763+
Dim msgBoxReturnValue As Integer
764+
765+
inputBoxReturnValue = InputBox("Dummy")
766+
msgBoxReturnValue = MsgBox("Dummy")
767+
768+
Fakes.MsgBox.Verify.Once
769+
Fakes.InputBox.Verify.Once
770+
771+
TestExit:
772+
Exit Sub
773+
TestFail:
774+
Assert.Fail "Test raised an error: #" & Err.Number & " - " & Err.Description
775+
End Sub
776+

0 commit comments

Comments
 (0)