Understanding how fees affect an order's filled quantity

I am using testnet to not only understand how the API works generally but more specifically understand the flow of orders. To the best of my knowledge, no fees apply on the testnet, a limitation that I feel shouldn’t apply as it hinders understanding of the API. The testnet should, in my opinion, replicate the same conditions found on mainnet so as to be as close as possible to the real thing.

The question I have is this: when placing a LIMIT order and specifying a (base) quantity, will the amount that gets filled be that quantity OR will it the quantity with fees deducted? For example, let’s say I wish to buy 1 BTC (quote is USDT) – will the order on mainnet fill with 1 BTC received (and .001 extra paid in fees) OR will it fill with .999 (1-.001) BTC?

When you place a limit order specifying a base quantity, the amount that gets filled is the quantity you specified, and fees are deducted separately once the trade is executed. In your example, if you place a limit order to buy 1 BTC using USDT, the order will be filled with 1 BTC (assuming your limit price is met). The fees will be charged separately on top of it.