@Test public void whenChangeProperty1_thenProperty2ChangeReceived() { PresentationModelPropertyChangeSpy spy = PresentationModelTester.spyPropertyChange( presentationModel, SamplePresentationModel.PROPERTY2); presentationModel.changeProperty1(); assertTrue(spy.isPropertyChanged()); }
@Test public void whenChangeProperty1Twice_thenProperty2ChangeReceivedTwice() { PresentationModelPropertyChangeSpy spy = PresentationModelTester.spyPropertyChange( presentationModel, SamplePresentationModel.PROPERTY2); presentationModel.changeProperty1(); presentationModel.changeProperty1(); assertThat(spy.getPropertyChangedCount(), is(2)); }