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