'How can I run xctest for return ViewController func

How to write XCTestCase for below code

class HelpViewUseCase: HelpUseCaseProtocol, SubscriptionsHelpProtocol, ProfileHelpProtocol {
      func getHelpViewController() -> UIViewController {
        HelpViewController()
      }
    }

Another class which I'm unable to test

class UnifiedDirectAppointmentViewModel: UnifiedHistoryRowViewModel {       
      var rowType: UnifiedHistoryTableRowType {
        .directBooking
      }
        
          let appointmentResponse: DirectBookingInfoModel
        
      init?(forRowModel rowModel: UnifiedHistoryRowModel) {
        guard let data = rowModel.data.data as? DirectBookingInfoModel else {
          Log.error("Failed init for appointment \(rowModel)")
          return nil
        }
        appointmentResponse = data
      }
        }
        
extension UnifiedDirectAppointmentViewModel {
      var reuseIdentifier: String {
        DirectAppointmentTableViewCell.identifier
      }
      var bundle: Bundle? {
        Bundle(for: DirectAppointmentTableViewCell.self)
      }
    }

I'm new to unit test and was wondering how can I test aove classes. Thanks in advance for the suggestions and help



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source