Was the way the Green Knight tested Gawain's virtues at the castle fair?
I can't tell you whether or not the testing in Sir Gawain and the Green Knight was fair. You have to decide that for yourself. All I can do is explain the tests, and give you some details to help you decide.
At the castle, Sir Gawain is tested by the Green Knight's wife. She visits Gawain in his bed chamber and tries to seduce him. He passes the test by politely declining her advances.
Second, the Green Knight suggests that he and Gawain exchange anything each receives during the three days of Gawain's stay at the castle. The Green Knight keeps his part of the bargain by sharing the game he kills hunting with Gawain. Gawain fails to fulfill his agreement when on the third day he does not exchange the magic girdle or belt he was given by the Green Knight's wife, because the girdle supposedly will protect him from harm. Since he is on his way to be beheaded by the Green Knight, the girdle is obviously valuable to him.
You'll have to decide whether or not these tests were fair, but remember, the consequence for failure was light: only a scratch.