Esempio n. 1
0
        public void ReturnInvalidForInvalidTag()
        {
            var element  = "<amazon:effect name1=\"bla\" />".ToXElement();
            var strategy = new AmazonEmotionStrategy();
            var errors   = strategy.Verify(element);

            Assert.AreEqual(VerificationState.MissingAttribute, errors.First().State);
        }
Esempio n. 2
0
        public void ReturnValidForValidTag()
        {
            var element  = "<amazon:emotion name=\"excited\" intensity=\"high\"/>".ToXElement();
            var strategy = new AmazonEmotionStrategy();
            var errors   = strategy.Verify(element);

            Assert.AreEqual(0, errors.Count());
        }
Esempio n. 3
0
        public void ReturnInvalidForInvalidIntensityAttributeValue()
        {
            var element  = "<amazon:effect name=\"excited\" intensity=\"higherThanNormal\" />".ToXElement();
            var strategy = new AmazonEmotionStrategy();
            var errors   = strategy.Verify(element).ToList();

            Assert.AreEqual(1, errors.Count);
            Assert.AreEqual(VerificationState.InvalidAttributeValue, errors[0].State);
        }