Skip to content
Snippets Groups Projects
Commit 09426404 authored by Bruno Muniz's avatar Bruno Muniz :apple:
Browse files

Finished cleaning integration except fT

parent 1f834bd7
No related branches found
No related tags found
2 merge requests!40v1.1.2b166,!38Using new database structure
...@@ -188,12 +188,12 @@ public final class BindingsMock: BindingsInterface { ...@@ -188,12 +188,12 @@ public final class BindingsMock: BindingsInterface {
extension Group { extension Group {
static let mockGroup = Group( static let mockGroup = Group(
leader: "mockGroupLeader".data(using: .utf8)!, id: "mockGroup".data(using: .utf8)!,
name: "Bruno's birthday 6/1", name: "Bruno's birthday 6/1",
groupId: "mockGroup".data(using: .utf8)!, leaderId: "mockGroupLeader".data(using: .utf8)!,
status: .pending,
createdAt: Date.distantPast, createdAt: Date.distantPast,
serialize: "mockGroup".data(using: .utf8)! authStatus: .pending,
serialized: "mockGroup".data(using: .utf8)!
) )
} }
...@@ -202,17 +202,18 @@ extension Contact { ...@@ -202,17 +202,18 @@ extension Contact {
var mocks = [Contact]() var mocks = [Contact]()
for n in 0..<count { for n in 0..<count {
mocks.append(.init( mocks.append(
photo: nil, .init(
userId: "brad\(n)".data(using: .utf8)!, id: "brad\(n)".data(using: .utf8)!,
email: "brad\(n)@xx.io", marshaled: "brad\(n)".data(using: .utf8)!,
phone: "819820212\(n)5BR", username: "brad\(n)",
status: .verified, email: "brad\(n)@xx.io",
marshaled: "brad\(n)".data(using: .utf8)!, phone: "819820212\(n)5BR",
username: "brad\(n)", nickname: nil,
nickname: nil, photo: nil,
createdAt: Date(), authStatus: .verified,
isRecent: false isRecent: false,
createdAt: Date()
)) ))
} }
...@@ -220,55 +221,55 @@ extension Contact { ...@@ -220,55 +221,55 @@ extension Contact {
} }
static let angelinaRequested = Contact( static let angelinaRequested = Contact(
photo: nil, id: "angelinajolie".data(using: .utf8)!,
userId: "angelinajolie".data(using: .utf8)!,
email: nil,
phone: nil,
status: .verificationInProgress,
marshaled: "angelinajolie".data(using: .utf8)!, marshaled: "angelinajolie".data(using: .utf8)!,
username: "angelinajolie", username: "angelinajolie",
email: nil,
phone: nil,
nickname: "Angelica Jolie", nickname: "Angelica Jolie",
createdAt: Date(), photo: nil,
isRecent: false authStatus: .verificationInProgress,
isRecent: false,
createdAt: Date()
) )
static let carlRequested = Contact( static let carlRequested = Contact(
photo: nil, id: "carlsagan".data(using: .utf8)!,
userId: "carlsagan".data(using: .utf8)!,
email: "carl@jpl.nasa",
phone: "81982022244BR",
status: .verified,
marshaled: "carlsagan".data(using: .utf8)!, marshaled: "carlsagan".data(using: .utf8)!,
username: "carlsagan", username: "carlsagan",
email: "carl@jpl.nasa",
phone: "81982022244BR",
nickname: "Carl Sagan", nickname: "Carl Sagan",
createdAt: Date.distantPast, photo: nil,
isRecent: false authStatus: .verified,
isRecent: false,
createdAt: Date.distantPast
) )
static let elonRequested = Contact( static let elonRequested = Contact(
photo: nil, id: "elonmusk".data(using: .utf8)!,
userId: "elonmusk".data(using: .utf8)!,
email: "elon@tesla.com",
phone: nil,
status: .verified,
marshaled: "elonmusk".data(using: .utf8)!, marshaled: "elonmusk".data(using: .utf8)!,
username: "elonmusk", username: "elonmusk",
email: "elon@tesla.com",
phone: nil,
nickname: "Elon Musk", nickname: "Elon Musk",
createdAt: Date.distantPast, photo: nil,
isRecent: false authStatus: .verified,
isRecent: false,
createdAt: Date.distantPast
) )
static let georgeDiscovered = Contact( static let georgeDiscovered = Contact(
photo: nil, id: "georgebenson74".data(using: .utf8)!,
userId: "georgebenson74".data(using: .utf8)!,
email: "george@xx.io",
phone: "81987022255BR",
status: .stranger,
marshaled: "georgebenson74".data(using: .utf8)!, marshaled: "georgebenson74".data(using: .utf8)!,
username: "bruno_muniz74", username: "bruno_muniz74",
email: "george@xx.io",
phone: "81987022255BR",
nickname: "Bruno Muniz", nickname: "Bruno Muniz",
createdAt: Date(), photo: nil,
isRecent: false authStatus: .stranger,
isRecent: false,
createdAt: Date()
) )
} }
......
...@@ -27,17 +27,18 @@ final class UserDiscoveryMock: UserDiscoveryInterface { ...@@ -27,17 +27,18 @@ final class UserDiscoveryMock: UserDiscoveryInterface {
_ completion: @escaping (Result<Contact, Error>) -> Void _ completion: @escaping (Result<Contact, Error>) -> Void
) { ) {
DispatchQueue.global().asyncAfter(deadline: .now() + 1) { DispatchQueue.global().asyncAfter(deadline: .now() + 1) {
completion(.success(.init( completion(.success(
photo: nil, .init(
userId: "mock_username".data(using: .utf8)!, id: "mock_username".data(using: .utf8)!,
email: nil, marshaled: "mock_username".data(using: .utf8)!,
phone: nil, username: "mock_username",
status: .stranger, email: nil,
marshaled: "mock_username".data(using: .utf8)!, phone: nil,
username: "mock_username", nickname: "mock_nickname",
nickname: "mock_nickname", photo: nil,
createdAt: Date(), authStatus: .stranger,
isRecent: false isRecent: false,
createdAt: Date()
))) )))
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment