attached and detached callbacks tests

Tests for attached and detached callbacks