Implemented the "empty" static constant for the String+Constants extension in the Foundation library.

This commit is contained in:
Javier Cicchelli 2024-03-16 02:13:20 +01:00
parent 4b66ffa4c3
commit e1c80b1705
2 changed files with 45 additions and 0 deletions

View File

@ -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 = ""
}

View File

@ -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)
}
}