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()); }
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()); }
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); }
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); }
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); }
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()); }
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); }
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()); }