@@ -333,65 +333,68 @@ class ScopeTest {
333333 assertEquals(1 , scope.breadcrumbs.count())
334334 }
335335
336- @Test
337- fun `when adding breadcrumb and maxBreadcrumb is 0, beforeBreadcrumb is not executed` () {
338- var called = false
339- val options = SentryOptions ().apply {
340- maxBreadcrumbs = 0
341- beforeBreadcrumb = SentryOptions .BeforeBreadcrumbCallback { breadcrumb, _ ->
342- called = true
343- breadcrumb
344- }
345- }
346-
347- val scope = Scope (options)
348- scope.addBreadcrumb(Breadcrumb ())
349- assertEquals(0 , scope.breadcrumbs.count())
350- assertFalse(called)
351- }
336+ @Test
337+ fun `when adding breadcrumb and maxBreadcrumb is 0, beforeBreadcrumb is not executed` () {
338+ var called = false
339+ val options =
340+ SentryOptions ().apply {
341+ maxBreadcrumbs = 0
342+ beforeBreadcrumb =
343+ SentryOptions .BeforeBreadcrumbCallback { breadcrumb, _ ->
344+ called = true
345+ breadcrumb
346+ }
347+ }
352348
353- @Test
354- fun `when adding breadcrumb and maxBreadcrumb is not 0, beforeBreadcrumb is executed` () {
355- var called = false
356- val options = SentryOptions ().apply {
357- beforeBreadcrumb = SentryOptions .BeforeBreadcrumbCallback { breadcrumb, _ ->
358- called = true
359- breadcrumb
360- }
361- }
362-
363- val scope = Scope (options)
364- scope.addBreadcrumb(Breadcrumb ())
365- assertEquals(1 , scope.breadcrumbs.count())
366- assertTrue(called)
367- }
349+ val scope = Scope (options)
350+ scope.addBreadcrumb(Breadcrumb ())
351+ assertEquals(0 , scope.breadcrumbs.count())
352+ assertFalse(called)
353+ }
368354
369- @Test
370- fun `when adding breadcrumb and maxBreadcrumb is 0, scopesObservers are not called` () {
371- val observer = mock<IScopeObserver >()
372- val options = SentryOptions ().apply {
373- maxBreadcrumbs = 0
374- addScopeObserver(observer)
375- }
376-
377- val scope = Scope (options)
378- scope.addBreadcrumb(Breadcrumb ())
379- assertEquals(0 , scope.breadcrumbs.count())
380- verifyNoInteractions(observer)
381- }
355+ @Test
356+ fun `when adding breadcrumb and maxBreadcrumb is not 0, beforeBreadcrumb is executed` () {
357+ var called = false
358+ val options =
359+ SentryOptions ().apply {
360+ beforeBreadcrumb =
361+ SentryOptions .BeforeBreadcrumbCallback { breadcrumb, _ ->
362+ called = true
363+ breadcrumb
364+ }
365+ }
382366
383- @Test
384- fun `when adding breadcrumb and maxBreadcrumb is not 0, scopesObservers are called` () {
385- val observer = mock<IScopeObserver >()
386- val options = SentryOptions ().apply {
387- addScopeObserver(observer)
388- }
389-
390- val scope = Scope (options)
391- scope.addBreadcrumb(Breadcrumb ())
392- assertEquals(1 , scope.breadcrumbs.count())
393- verify(observer).addBreadcrumb(any())
394- }
367+ val scope = Scope (options)
368+ scope.addBreadcrumb(Breadcrumb ())
369+ assertEquals(1 , scope.breadcrumbs.count())
370+ assertTrue(called)
371+ }
372+
373+ @Test
374+ fun `when adding breadcrumb and maxBreadcrumb is 0, scopesObservers are not called` () {
375+ val observer = mock<IScopeObserver >()
376+ val options =
377+ SentryOptions ().apply {
378+ maxBreadcrumbs = 0
379+ addScopeObserver(observer)
380+ }
381+
382+ val scope = Scope (options)
383+ scope.addBreadcrumb(Breadcrumb ())
384+ assertEquals(0 , scope.breadcrumbs.count())
385+ verifyNoInteractions(observer)
386+ }
387+
388+ @Test
389+ fun `when adding breadcrumb and maxBreadcrumb is not 0, scopesObservers are called` () {
390+ val observer = mock<IScopeObserver >()
391+ val options = SentryOptions ().apply { addScopeObserver(observer) }
392+
393+ val scope = Scope (options)
394+ scope.addBreadcrumb(Breadcrumb ())
395+ assertEquals(1 , scope.breadcrumbs.count())
396+ verify(observer).addBreadcrumb(any())
397+ }
395398
396399 @Test
397400 fun `when adding eventProcessor, eventProcessor should be in the list` () {
0 commit comments