How to verify meta box is registered in Unit Testing?

Here is what i have did as a workaround, i realized we cant do that in TDD way.so its better to write the code first instead of writing the test when you face this problem.

So in my code i have added this

add_meta_box( 'meta-box-id', __( 'My Meta Box', 'textdomain' ), 'wpdocs_my_display_callback', 'post' );

and in test the $wp_meta_boxes is now displaying the array of registered meta boxes.

array(1) {
  ["post"]=>
  array(1) {
    ["advanced"]=>
    array(1) {
      ["default"]=>
      array(1) {
        ["meta-box-id"]=>
        array(4) {
          ["id"]=>
          string(11) "meta-box-id"
          ["title"]=>
          string(11) "My Meta Box"
          ["callback"]=>
          string(26) "wpdocs_my_display_callback"
          ["args"]=>
          NULL
        }
      }
    }
  }
}

This changes nothing, the code still remains the same, but the way of writing differs now due to this issue.