write tests for Transformer