Armorers check for fit & function to make sure the new assembly (it's an assembly if it came with the stirrup and pin

) works normally with the other existing parts in any particular gun.
While there's no way to determine online whether any particular part or assembly will work normally in any particular gun, the S&W hammers are essentially drop-in AND inspect for fit & function assemblies. If one hammer assembly doesn't work in a particular gun, you don't "fix it", you simply try another one. (Sometimes another part may be worn, though, such as the sear or drawbar, and the "new" and/or "used" hammer simply makes it come to your attention.)
Bench checking an EMPTY gun and EMPTY mag (sorry for the shouting, but safety is paramount and complacency can sneak up on all of us) ... armorers do the following checks:
Cock the hammer in SA (Single Action) and gently attempt to push it off. Don't
shove on it, or it'll probably fall forward all right, but only after having damaged the SA cocking notches of the hammer and/or the sear nose. This is just like checking for push-off with a cocked revolver.
Pulling the trigger fully through in DA (Double Action) to confirm it moves and falls normally. Self explanatory.
Rocking the hammer in DA to check for rounded edges. This involves pulling the hammer approx almost halfway through the DA pull, and then slowly releasing the trigger to let the hammer return forward
under control. Not falling off too soon. "Rocking the hammer" back & forth with the trigger. The goal here is to check that the hammer doesn't slip (off the drawbar) and fall prematurely. This check is repeated at least 5 successful times (partial trigger pulls). If the hammer is too worn for that drawbar, the pickup notch on the hammer (or drawbar, for that matter) might not be able to hold contact long enough to pass the hammer off to the drawbar's Throw Notch. (FWIW, each "notch" is actually a pair of notches, since there's a cut down the center of the hammer for stirrup clearance.)
It's not unknown for an armorer to sometimes have to try more than one assembly (hammer, drawbar, sear, etc) when replacing something in order to get all the tolerances, of all the parts that have to work together, to exhibit normal function and operation in any particular gun.
Parts is parts, as they say, but sometimes a part that won't work in one gun may work just fine in several others of the same make/model.