Skip to content

Commit 95edd0f

Browse files
committed
Make missing NetworkingCore elements fakeable
1 parent ebc4b23 commit 95edd0f

File tree

5 files changed

+27
-19
lines changed

5 files changed

+27
-19
lines changed

Modules/Sources/Fakes/NetworkingCore.generated.swift

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,15 @@ extension NetworkingCore.DotcomError {
4545
.empty
4646
}
4747
}
48+
extension NetworkingCore.MetaContainer {
49+
/// Returns a "ready to use" type filled with fake values.
50+
///
51+
public static func fake() -> NetworkingCore.MetaContainer {
52+
.init(
53+
payload: .fake()
54+
)
55+
}
56+
}
4857
extension NetworkingCore.MetaData {
4958
/// Returns a "ready to use" type filled with fake values.
5059
///
@@ -85,6 +94,13 @@ extension NetworkingCore.Note {
8594
)
8695
}
8796
}
97+
extension NetworkingCore.Note.Kind {
98+
/// Returns a "ready to use" type filled with fake values.
99+
///
100+
public static func fake() -> NetworkingCore.Note.Kind {
101+
.automattcher
102+
}
103+
}
88104
extension NetworkingCore.NoteBlock {
89105
/// Returns a "ready to use" type filled with fake values.
90106
///
@@ -128,6 +144,13 @@ extension NetworkingCore.NoteRange {
128144
)
129145
}
130146
}
147+
extension NetworkingCore.NoteRange.Kind {
148+
/// Returns a "ready to use" type filled with fake values.
149+
///
150+
public static func fake() -> NetworkingCore.NoteRange.Kind {
151+
.user
152+
}
153+
}
131154
extension NetworkingCore.Order {
132155
/// Returns a "ready to use" type filled with fake values.
133156
///

Modules/Sources/NetworkingCore/Model/MetaContainer.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
import Codegen
12
import Foundation
23

34

45
// MARK: - MetaContainer: Simple API to query the "Notification Meta" Collection.
56
//
6-
public struct MetaContainer {
7+
public struct MetaContainer: GeneratedFakeable {
78

89
/// The actual Meta Payload.
910
///

Modules/Sources/NetworkingCore/Model/Note.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ extension Note {
264264

265265
/// Known Notification Kinds
266266
///
267-
public enum Kind: String {
267+
public enum Kind: String, GeneratedFakeable {
268268
case automattcher
269269
case comment
270270
case commentLike = "comment_like"

Modules/Sources/NetworkingCore/Model/NoteBlock.swift

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -28,22 +28,6 @@ public struct NoteBlock: Equatable, GeneratedFakeable, GeneratedCopiable {
2828
/// Raw Type, expressed as a string.
2929
///
3030
public let type: String?
31-
32-
public init(
33-
media: [NoteMedia],
34-
ranges: [NoteRange],
35-
text: String?,
36-
actions: [String: Bool],
37-
meta: MetaContainer,
38-
type: String?
39-
) {
40-
self.media = media
41-
self.ranges = ranges
42-
self.text = text
43-
self.actions = actions
44-
self.meta = meta
45-
self.type = type
46-
}
4731
}
4832

4933
extension NoteBlock {

Modules/Sources/NetworkingCore/Model/NoteRange.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ extension NoteRange {
160160

161161
/// Known Range Types.
162162
///
163-
public enum Kind: String {
163+
public enum Kind: String, GeneratedFakeable {
164164
case user
165165
case post
166166
case comment

0 commit comments

Comments
 (0)