You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
PadelClub/PadelClubTests/UserDataTests.swift

39 lines
1.3 KiB

//
// UserDataTests.swift
// PadelClubTests
//
// Created by Laurent Morvillier on 13/05/2024.
//
import XCTest
import LeStorage
@testable import PadelClub
final class UserDataTests: XCTestCase {
let username: String = "test"
let password: String = "MyPass1234--"
override func setUpWithError() throws {
Store.main.synchronizationApiURL = "http://127.0.0.1:8000/api/"
}
override func tearDownWithError() throws {
// Put teardown code here. This method is called after the invocation of each test method in the class.
}
func testUserCreation() async throws {
let userCreationForm = UserCreationForm(username: self.username, password: self.password, firstName: "jean", lastName: "coco", email: "laurent@staxriver.com", phone: "0123", country: "France")
let user: User = try await Store.main.service().createAccount(user: userCreationForm)
assert(user.username == userCreationForm.username)
assert(user.firstName == userCreationForm.firstName)
assert(user.lastName == userCreationForm.lastName)
assert(user.email == userCreationForm.email)
assert(user.phone == userCreationForm.phone)
assert(user.country == userCreationForm.country)
}
}