This depends on the form of the preparation. In general it can be said that it makes no sense to perform the test directly after a vitamin B12 injection. After an injection you should wait at least three weeks before testing your vitamin B12 level. Otherwise, only the vitamin B12 which circulating through the bloodstream is measured.
For all other forms, testing while taking supplemental doses may be useful to determine if the vitamin B12 level is within the desired range. Here it is also recommended to wait one week after the last dose of the supplement and then perform the test.