public void ProducesCorrectTauntString(string slackUserRealName, string slackUserHandle, string entryName, string expectedTauntName)
        {
            // Arrange


            // Act
            var formattedEvents = GameweekEventsFormatter.FormatNewFixtureEvents(CreateGoalEvent(), CreateTransferOutForGoalScorerContext(slackUserRealName, slackUserHandle, entryName));

            foreach (var formatttedEvent in formattedEvents)
            {
                _helper.WriteLine(formatttedEvent);
            }
            // Assert
            var formattedEvent = formattedEvents.First();
            var regex          = new Regex("\\{0\\}.*");

            CustomAssert.AnyOfContains(new GoalTaunt().JokePool.Select(x => regex.Replace(x, string.Empty)), formattedEvent);
            Assert.Contains(expectedTauntName, formattedEvent);
        }
Esempio n. 2
0
    public void ProducesCorrectTauntString(string slackUserRealName, string slackUserHandle, string entryName, string expectedTauntName)
    {
        // Arrange


        // Act
        var formattedEvents = GameweekEventsFormatter.FormatNewFixtureEvents(CreateGoalEvent(), subscribes => true, FormattingType.Slack, CreateTransferOutForGoalScorerContext(slackUserRealName, slackUserHandle, entryName));

        foreach (var formatttedEvent in formattedEvents)
        {
            _helper.WriteLine($"{formatttedEvent.Title} {formatttedEvent.Details}");
        }
        // Assert
        var formattedEvent = formattedEvents.First();
        var regex          = new Regex("\\{0\\}.*");

        CustomAssert.AnyOfContains(GoalDescriber.GoalJokes.Select(x => regex.Replace(x, string.Empty)), formattedEvent.Details);
        Assert.Contains(expectedTauntName, formattedEvent.Details);
    }