Added test coverage for sun component
Clean up code sun component tests
Added tests for switch component
Fix to make tests work on Travis CI