예제 #1
0
        public void ReturnInvalidWithInvalidEndTimeComma()
        {
            var element  = "<media end=\"300,92ms\"/>".ToXElement();
            var strategy = new MediaStrategy();
            var errors   = strategy.Verify(element, SsmlPlatform.Google);

            Assert.AreEqual(VerificationState.InvalidAttributeValue, errors.First().State);
        }
예제 #2
0
        public void ReturnValidWithEndTimeMinusValue()
        {
            var element  = "<media end=\"-30ms\"/>".ToXElement();
            var strategy = new MediaStrategy();
            var errors   = strategy.Verify(element, SsmlPlatform.Google);

            Assert.AreEqual(0, errors.Count());
        }
예제 #3
0
        public void ReturnValidForSoundLevelWith1Decimals()
        {
            var element  = "<media soundLevel=\"+30.3dB\" src=\"http://test.com/test.mp3\" />".ToXElement();
            var strategy = new MediaStrategy();
            var errors   = strategy.Verify(element, SsmlPlatform.Google);

            Assert.AreEqual(0, errors.Count());
        }
예제 #4
0
        public void ReturnValidWithFadeOutDurTimePlusValue()
        {
            var element  = "<media fadeOutDur=\"+30ms\"/>".ToXElement();
            var strategy = new MediaStrategy();
            var errors   = strategy.Verify(element, SsmlPlatform.Google);

            Assert.AreEqual(0, errors.Count());
        }
예제 #5
0
        public void ReturnInvalidForInvalidSoundLevelTooMuchDecimals()
        {
            var element  = "<media soundLevel=\"+30.003dB\" src=\"http://test.com/test.mp3\" />".ToXElement();
            var strategy = new MediaStrategy();
            var errors   = strategy.Verify(element, SsmlPlatform.Google);

            Assert.AreEqual(VerificationState.InvalidAttributeValue, errors.First().State);
        }
예제 #6
0
        public void ReturnValidWithValidBeginTime()
        {
            var element  = "<media begin=\"300.92ms\"/>".ToXElement();
            var strategy = new MediaStrategy();
            var errors   = strategy.Verify(element, SsmlPlatform.Google);

            Assert.AreEqual(0, errors.Count());
        }
예제 #7
0
        public void ReturnInvalidWithInvalidRepeatCountPlusValue()
        {
            var element  = "<media repeatCount=\"+3\"/>".ToXElement();
            var strategy = new MediaStrategy();
            var errors   = strategy.Verify(element, SsmlPlatform.Google);

            Assert.AreEqual(0, errors.Count());
        }
예제 #8
0
        public void ReturnInvalidWithInvalidRepeatCountMinusValue()
        {
            var element  = "<media repeatCount=\"-3\"/>".ToXElement();
            var strategy = new MediaStrategy();
            var errors   = strategy.Verify(element, SsmlPlatform.Google);

            Assert.AreEqual(VerificationState.InvalidAttributeValue, errors.First().State);
        }
예제 #9
0
        public void ReturnValidForValidTag()
        {
            var element  = "<media xml:id=\"123\" repeatCount=\"3\" soundLevel=\"+2.28dB\" fadeInDur=\"2s\" fadeOutDur=\"0.2s\"/>".ToXElement();
            var strategy = new MediaStrategy();
            var errors   = strategy.Verify(element, SsmlPlatform.Google);

            Assert.AreEqual(0, errors.Count());
        }