I went back and looked through the htmx source and it appears as though your original comment about whether ordering mattered for the SwapStyleBuilder was on the money. Every part of the swap specification is parsed into a single SwapSpec object so I created an object that would at least hold the values for the commands. This would ensure that no command would be repeated. The builder then just produces the final string result from the HtmxSwapSpecification record. The tests were updated accordingly to use SwapStyle.Default which equates to the empty string.
I went back and looked through the htmx source and it appears as though your original comment about whether ordering mattered for the SwapStyleBuilder was on the money. Every part of the swap specification is parsed into a single SwapSpec object so I created an object that would at least hold the values for the commands. This would ensure that no command would be repeated. The builder then just produces the final string result from the HtmxSwapSpecification record. The tests were updated accordingly to use SwapStyle.Default which equates to the empty string.