<commit_before>import XCTest

/*
* User story
* Title: Posting messages to timeline
* As a user
* I want to be able to post messages
* So that I can publish messages to my timeline
*/
class PostingMessagesFeature: XCTestCase {

  private let aTimestamp = 12312312312
  private var clock: Clock!

  override func setUp() {
    super.setUp()
    clock = TestableClock(timestamp: aTimestamp)
  }

  /*
  * Scenario 1:
  * Given then user Bob
  * When user publish the message "Damn! We lost!" ( Bob -> Damn! We lost! )
  * Then the user timeline should contain post
  */
  func testShouldPublishMessageToUserTimeline() {
    let user = givenBobUser()
    let postRepository = givenPostsRepository()
    let socialNetwork = givenSocialNetworkWithPostAction(givenPostActionWith(postRepository))
    let message = givenMessage()
    let input = givenPostActionInput(user, message: message)

    socialNetwork.execute(input)

    let expectPost = Post(user: user, message: message, timestamp: aTimestamp)
    let expectedTimeline = [Post](arrayLiteral: expectPost)
    XCTAssertEqual(expectedTimeline, postRepository.timelineOf(user))
  }

  private func givenPostActionInput(user: User, message: String) -> Input {
    return Input(input: "\(user.name) -> \(message)")
  }

  private func givenMessage() -> String {
    return "Damn! We lost!"
  }

  private func givenSocialNetworkWithPostAction(postAction: PostAction) -> SocialNetwork {
    let actions = [Action](arrayLiteral: postAction)
    return SocialNetwork(actions: actions)
  }

  private func givenPostActionWith(postRepository: PostRepository) -> PostAction {
    return PostAction(postRepository: postRepository, clock: clock)
  }

  private func givenPostsRepository() -> PostRepository {
    return PostRepository()
  }

  private func givenBobUser() -> User {
    return User(name: "Bob")
  }
}
<commit_msg>Improve posting feature user story name<commit_after>import XCTest

/*
* User story
* Title: Posting messages to user timeline
* As a user
* I want to be able to post messages
* So that I can publish messages to my timeline
*/
class PostingMessagesFeature: XCTestCase {

  private let aTimestamp = 12312312312
  private var clock: Clock!

  override func setUp() {
    super.setUp()
    clock = TestableClock(timestamp: aTimestamp)
  }

  /*
  * Scenario 1:
  * Given then user Bob
  * When user publish the message "Damn! We lost!" ( Bob -> Damn! We lost! )
  * Then the user timeline should contain post
  */
  func testShouldPublishMessageToUserTimeline() {
    let user = givenBobUser()
    let postRepository = givenPostsRepository()
    let socialNetwork = givenSocialNetworkWithPostAction(givenPostActionWith(postRepository))
    let message = givenMessage()
    let input = givenPostActionInput(user, message: message)

    socialNetwork.execute(input)

    let expectPost = Post(user: user, message: message, timestamp: aTimestamp)
    let expectedTimeline = [Post](arrayLiteral: expectPost)
    XCTAssertEqual(expectedTimeline, postRepository.timelineOf(user))
  }

  private func givenPostActionInput(user: User, message: String) -> Input {
    return Input(input: "\(user.name) -> \(message)")
  }

  private func givenMessage() -> String {
    return "Damn! We lost!"
  }

  private func givenSocialNetworkWithPostAction(postAction: PostAction) -> SocialNetwork {
    let actions = [Action](arrayLiteral: postAction)
    return SocialNetwork(actions: actions)
  }

  private func givenPostActionWith(postRepository: PostRepository) -> PostAction {
    return PostAction(postRepository: postRepository, clock: clock)
  }

  private func givenPostsRepository() -> PostRepository {
    return PostRepository()
  }

  private func givenBobUser() -> User {
    return User(name: "Bob")
  }
}

{'fraction_non_alphanumeric': 0.09286282833642875, 'fraction_numerical': 0.006367736800212258, 'mean_word_length': 4.171467764060357, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3873307', 'n_tokens_mistral': 1109, 'n_tokens_neox': 1039, 'n_words': 326}