Add tests from TTWF Shanghai

Tests have been roughly reviewed and we need more work on them.