Implemented the "empty" static constant for the String+Constants extension in the Foundation library.
This commit is contained in:
parent
4b66ffa4c3
commit
e1c80b1705
@ -0,0 +1,18 @@
|
||||
//
|
||||
// String+Constants.swift
|
||||
// ReviewsFoundation
|
||||
//
|
||||
// Created by Javier Cicchelli on 16/03/2024.
|
||||
// Copyright © 2024 Röck+Cöde VoF. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
public extension String {
|
||||
|
||||
// MARK: Constants
|
||||
|
||||
/// A representation of an empty string.
|
||||
static let empty: String = ""
|
||||
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
//
|
||||
// String+ConstantsTests.swift
|
||||
// ReviewsFoundationTest
|
||||
//
|
||||
// Created by Javier Cicchelli on 16/03/2024.
|
||||
// Copyright © 2024 Röck+Cöde VoF. All rights reserved.
|
||||
//
|
||||
|
||||
import ReviewsFoundation
|
||||
import XCTest
|
||||
|
||||
final class String_ConstantsTests: XCTestCase {
|
||||
|
||||
// MARK: Properties
|
||||
private var sut: String!
|
||||
|
||||
// MARK: Constants tests
|
||||
func testEmpty() throws {
|
||||
// GIVEN
|
||||
sut = .empty
|
||||
|
||||
// WHEN
|
||||
// THEN
|
||||
XCTAssertTrue(sut.isEmpty)
|
||||
}
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user