Skip to content

Commit 1ecc58d

Browse files
committed
Correct ResumeFake method and add test to make sure that happens
1 parent 2ab4d27 commit 1ecc58d

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

Rubberduck.Main/ComClientLibrary/UnitTesting/FakesProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public static void ResumeFake(String typename)
5555
{
5656
if (fake.GetType().Name == typename)
5757
{
58-
fake.DisableHook();
58+
fake.EnableHook();
5959
return;
6060
}
6161
}

RubberduckTests/IntegrationTests/FakeTests.bas

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -737,14 +737,16 @@ Public Sub TestIssue4476()
737737
'Arrange:
738738
Fakes.Now.PassThrough = True
739739
Fakes.Date.PassThrough = True
740+
Dim retVal As Variant
740741

741742
'Act:
742-
Debug.Print Now
743-
Debug.Print Date '<== KA-BOOOM
743+
retVal = Now
744+
retVal = Date '<== KA-BOOOM
745+
retVal = Now 'ensure fake reinstated
744746

745747
'Assert:
746-
Fakes.Now.Verify.AtLeastOnce
747-
Fakes.Date.Verify.AtLeastOnce
748+
Fakes.Now.Verify.Exactly 2
749+
Fakes.Date.Verify.Once
748750

749751
TestExit:
750752
Exit Sub

0 commit comments

Comments
 (0)