public void ShouldBeAbleToHandleDifferentPronunciations(PronounceRole role, string expected) { string speech = new Speech() .Say("The word") .Say("read") .AsCharacters() .Say("may be interpreted as") .Say("read") .PronounceAs(role) .Build(); speech.Should().Be($"<speak>The word <say-as interpret-as=\"characters\">read</say-as> may be interpreted as <w role=\"{expected}\">read</w></speak>"); }
public PronounceWriter(ISpeechWriter writer, PronounceRole role) { _writer = writer; _role = role; }
public ISpeech PronounceAs(PronounceRole role) { _writer = new PronounceWriter(_writer, role); return(this); }