Exemple #1
0
 private string FormatJoke(CharacterName characterName, Joke joke)
 {
     if (characterName != null)
     {
         return(joke.ReplacedName(characterName.ToString()));
     }
     else
     {
         return(joke.Value);
     }
 }
Exemple #2
0
        public void ReplacedWith_Should_NotReplaceName()
        {
            // Given
            var sut = new Joke()
            {
                Value = $"{DefaultName} says hello"
            };

            // When
            var replaced = sut.ReplacedName(NewName);

            // Then
            Assert.Equal($"{DefaultName} says hello", replaced);
        }