-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathBugSplat+Testing.h
More file actions
88 lines (71 loc) · 2.27 KB
/
BugSplat+Testing.h
File metadata and controls
88 lines (71 loc) · 2.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
//
// BugSplat+Testing.h
//
// Private testing interface for BugSplat.
// This header exposes internal methods for unit testing.
//
// Copyright © BugSplat, LLC. All rights reserved.
//
#import <BugSplat/BugSplat.h>
#import "BugSplatTestSupport.h"
#import "BugSplatUploadService.h"
NS_ASSUME_NONNULL_BEGIN
/**
* Class extension to expose private methods for testing.
* These methods are implemented in the main BugSplat class.
*/
@interface BugSplat ()
- (BOOL)shouldSendCrashSilently:(NSDictionary *)metadata;
- (NSString *)resolvedApplicationName;
- (NSString *)resolvedApplicationVersion;
@end
/**
* Testing interface for BugSplat.
* Exposes internal methods and allows dependency injection for unit testing.
*/
@interface BugSplat (Testing)
/**
* Create a new BugSplat instance for testing with injected dependencies.
* This does NOT affect the shared singleton.
*
* @param crashReporter A mock crash reporter.
* @param crashStorage A mock crash storage.
* @param userDefaults A mock user defaults.
* @param bundle A mock bundle.
* @return A new BugSplat instance for testing.
*/
+ (instancetype)testInstanceWithCrashReporter:(id<BugSplatCrashReporterProtocol>)crashReporter
crashStorage:(id<BugSplatCrashStorageProtocol>)crashStorage
userDefaults:(id<BugSplatUserDefaultsProtocol>)userDefaults
bundle:(id<BugSplatBundleProtocol>)bundle;
/**
* Internal method to set the upload service (for testing).
*/
- (void)setUploadServiceForTesting:(BugSplatUploadService *)uploadService;
/**
* Check if start has been invoked.
*/
- (BOOL)isStartInvoked;
/**
* Check if sending is in progress.
*/
- (BOOL)isSendingInProgress;
/**
* Get the current crash filename being processed.
*/
- (nullable NSString *)currentCrashFilename;
/**
* Get the crash reporter (for verification).
*/
- (id<BugSplatCrashReporterProtocol>)crashReporter;
/**
* Get the crash storage (for verification).
*/
- (id<BugSplatCrashStorageProtocol>)crashStorage;
/**
* Override debugger detection for testing.
* Pass @YES to simulate debugger attached, @NO to simulate no debugger, nil to use real detection.
*/
- (void)setDebuggerAttachedOverride:(nullable NSNumber *)value;
@end
NS_ASSUME_NONNULL_END