(t *testing.T)
| 2083 | } |
| 2084 | |
| 2085 | func Test_WaitUntil_Parallel(t *testing.T) { |
| 2086 | t.Parallel() |
| 2087 | |
| 2088 | // make a test impl object |
| 2089 | var mockedService = new(TestExampleImplementation) |
| 2090 | |
| 2091 | ch1 := make(chan time.Time) |
| 2092 | ch2 := make(chan time.Time) |
| 2093 | |
| 2094 | mockedService.Mock.On("TheExampleMethod2", true).Return().WaitUntil(ch2).Run(func(args Arguments) { |
| 2095 | ch1 <- time.Now() |
| 2096 | }) |
| 2097 | |
| 2098 | mockedService.Mock.On("TheExampleMethod2", false).Return().WaitUntil(ch1) |
| 2099 | |
| 2100 | // Lock both goroutines on the .WaitUntil method |
| 2101 | go func() { |
| 2102 | mockedService.TheExampleMethod2(false) |
| 2103 | }() |
| 2104 | go func() { |
| 2105 | mockedService.TheExampleMethod2(true) |
| 2106 | }() |
| 2107 | |
| 2108 | // Allow the first call to execute, so the second one executes afterwards |
| 2109 | ch2 <- time.Now() |
| 2110 | } |
| 2111 | |
| 2112 | func Test_MockMethodCalled(t *testing.T) { |
| 2113 | t.Parallel() |
nothing calls this directly
no test coverage detected
searching dependent graphs…