Guest User

Untitled

a guest
Dec 12th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. import Foundation
  2. @testable import Shopify_POS
  3.  
  4. class CustomerEntryViewModelTests: XCTestCase {
  5. var viewModel: CustomerEntryViewModel!
  6.  
  7. override func setUp() {
  8. super.setUp()
  9. viewModel = CustomerEntryViewModel(/* mock properties */)
  10. }
  11.  
  12. func testTaxExemptIsFalseByDefault() {
  13. XCTAssertFalse(viewModel.taxExempt)
  14. }
  15.  
  16. func testIsValidReturnsFalseForInvalidPhone() {
  17. viewModel.firstName = "First Name"
  18. viewModel.phone = "9820"
  19. XCTAssertFalse(viewModel.isValid)
  20. viewModel.phone = "9028025170"
  21. XCTAssertTrue(viewModel.isValid)
  22. }
  23. }
Add Comment
Please, Sign In to add comment