예제 #1
0
        public void ReturnValidForValidMinusSoundLevel()
        {
            var element  = "<audio clipBegin=\"3s\" soundLevel=\"-39dB\" src=\"http://test.com/test.mp3\" />".ToXElement();
            var strategy = new AudioStrategy();
            var errors   = strategy.Verify(element, SsmlPlatform.Google);

            Assert.AreEqual(0, errors.Count());
        }
예제 #2
0
        public void ReturnValidWithRepeatDurMinusValue()
        {
            var element  = "<audio src=\"http://test.com/test.mp3\" repeatDur=\"-30ms\"/>".ToXElement();
            var strategy = new AudioStrategy();
            var errors   = strategy.Verify(element, SsmlPlatform.Google);

            Assert.AreEqual(0, errors.Count());
        }
예제 #3
0
        public void ReturnValidForInvalidSpeedWithMalformedPercentage()
        {
            var element  = "<audio clipBegin=\"3s\" speed=\"50s\" src=\"http://test.com/test.mp3\" />".ToXElement();
            var strategy = new AudioStrategy();
            var errors   = strategy.Verify(element, SsmlPlatform.Google);

            Assert.AreEqual(VerificationState.InvalidAttributeValue, errors.First().State);
        }
예제 #4
0
        public void ReturnInvalidWithInvalidRepeatDurComma()
        {
            var element  = "<audio src=\"http://test.com/test.mp3\" repeatDur=\"300,92ms\"/>".ToXElement();
            var strategy = new AudioStrategy();
            var errors   = strategy.Verify(element, SsmlPlatform.Google);

            Assert.AreEqual(VerificationState.InvalidAttributeValue, errors.First().State);
        }
예제 #5
0
        public void ReturnInvalidForMissingSrc()
        {
            var element  = "<audio clipBegin=\"3s\" />".ToXElement();
            var strategy = new AudioStrategy();
            var errors   = strategy.Verify(element);

            Assert.AreEqual(VerificationState.MissingAttribute, errors.First().State);
        }
예제 #6
0
        public void ReturnValidWithValidClipEnd()
        {
            var element  = "<audio src=\"http://test.com/test.mp3\" clipEnd=\"300.92ms\"/>".ToXElement();
            var strategy = new AudioStrategy();
            var errors   = strategy.Verify(element, SsmlPlatform.Google);

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

            Assert.AreEqual(VerificationState.InvalidAttributeValue, errors.First().State);
        }
예제 #8
0
        public void ReturnValidForValidTag()
        {
            var element  = "<audio clipBegin=\"3s\" src=\"http://test.com/test.mp3\" />".ToXElement();
            var strategy = new AudioStrategy();
            var errors   = strategy.Verify(element);

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