@@ -9,43 +9,38 @@ import XCTest
99import SwiftUI
1010@testable import sharelink_for_swiftui
1111
12+
1213final class ShareLinkButtonTests : XCTestCase {
1314
14- func testShareText( ) {
15+ @ MainActor func testShareText( ) {
1516 let shareLinkButton = ShareLinkButton ( item: " Hello, world! " ) {
1617 Text ( " Share Text " )
1718 }
1819 XCTAssertNotNil ( shareLinkButton)
1920 }
2021
21- func testShareURL( ) {
22+ @ MainActor func testShareURL( ) {
2223 let url = URL ( string: " https://example.com " ) !
2324 let shareLinkButton = ShareLinkButton ( item: url) {
2425 Text ( " Share URL " )
2526 }
2627 XCTAssertNotNil ( shareLinkButton)
2728 }
2829
29- func testShareImage( ) {
30+ @ MainActor func testShareImage( ) {
3031 let image = UIImage ( systemName: " photo " ) !
3132 let shareLinkButton = ShareLinkButton ( item: image) {
3233 Image ( systemName: " photo " )
3334 }
3435 XCTAssertNotNil ( shareLinkButton)
3536 }
3637
37- func testCustomActivity( ) {
38+ @ MainActor func testCustomActivity( ) {
3839 let customActivity = UIActivity ( )
3940 let shareLinkButton = ShareLinkButton ( item: " Custom Activity " , applicationActivities: [ customActivity] ) {
4041 Text ( " Share Custom Activity " )
4142 }
4243 XCTAssertNotNil ( shareLinkButton)
4344 }
44-
45- static var allTests = [
46- ( " testShareText " , testShareText) ,
47- ( " testShareURL " , testShareURL) ,
48- ( " testShareImage " , testShareImage) ,
49- ( " testCustomActivity " , testCustomActivity) ,
50- ]
45+
5146}
0 commit comments