Beispiel #1
0
        public async Task ShouldReturnEmphasisedWordWithLevel(EmphasiseLevel level, string expected)
        {
            var xml = await new Ssml().Say("Hello")
                      .Say("World")
                      .Emphasised(level)
                      .ToStringAsync();

            xml.Should().Be($@"<?xml version=""1.0"" encoding=""utf-16""?><speak version=""1.0"" xml:lang=""en-US"">Hello <emphasis level=""{expected}"">World</emphasis></speak>");
        }
Beispiel #2
0
        public void ShouldEmphasiseAndSetTheEmphasiseLevelToGivenPartOfTheSentence(EmphasiseLevel level, string expected)
        {
            string speech = new Speech()
                            .Say("I already told you I")
                            .Say("really like")
                            .Emphasise(level)
                            .Say("that person.")
                            .Build();

            speech.Should().Be($"<speak>I already told you I <emphasis level=\"{expected}\">really like</emphasis> that person.</speak>");
        }
 public EmphasiseWriter(ISpeechWriter writer, EmphasiseLevel level)
 {
     _writer = writer;
     _level  = level;
 }
        public ISsml Emphasised(EmphasiseLevel level)
        {
            _ssmlWriter = new EmphasiseWriter(_ssmlWriter, level);

            return(this);
        }
Beispiel #5
0
 public EmphasiseWriter(ISsmlWriter innerWriter, EmphasiseLevel emphasiseLevel)
 {
     _innerWriter    = innerWriter;
     _emphasiseLevel = emphasiseLevel;
 }
Beispiel #6
0
 public ISpeech Emphasise(EmphasiseLevel level)
 {
     _writer = new EmphasiseWriter(_writer, level);
     return(this);
 }