You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
func testPostDouble_generatesOnlyOneNotification(){
// given
letexp=expectation(forNotification:AlertNotification.name, object: sut)
exp.expectedFulfillmentCount =2
exp.isInverted = true
letalert=Alert("this is an alert")
// when
sut.postAlert(alert: alert)
sut.postAlert(alert: alert)
// then
wait(for:[exp], timeout:1)}
위 코드를 왜 아래처럼 작성하지 않았는지 궁금 ! 도대체 isInverted를 어떻게 써야 잘 썼다고 들을 수 있을까?
func testPostDouble_generatesOnlyOneNotification(){
//given
letexp=expectation(
forNotification:AlertNotification.name,
object: sut,
handler:nil)
exp.expectedFulfillmentCount =1letalert=Alert("this is an alert")
// when
sut.postAlert(alert: alert)
sut.postAlert(alert: alert)
// then
wait(for:[exp], timeout:1)}
찾아본 것
this test fails if the expectation is fulfilled and succeeds if the wait times out
= this test will fail if two notifications are triggered by the two alerts.
The text was updated successfully, but these errors were encountered:
궁금한점
isInverted를 왜 사용해야하는지?
찾아본 것
this test fails if the expectation is fulfilled and succeeds if the wait times out
= this test will fail if two notifications are triggered by the two alerts.
The text was updated successfully, but these errors were encountered: