Пример #1
0
        public void EventCodeWithValueAndValueNameIsValid()
        {
            string value = "SVR";
            string valueName = "HSAS";
            var eventCode = new EventCode(value, valueName);

            var eventCodeValidator = new EventCodeValidator(eventCode);
            Assert.True(eventCodeValidator.IsValid);
        }
Пример #2
0
        public void EventCodeWithNullValueAndValueNameIsInvalid()
        {
            string value = null;
            string valueName = "HSAS";
            var eventCode = new EventCode(value, valueName);

            var eventCodeValidator = new EventCodeValidator(eventCode);
            Assert.False(eventCodeValidator.IsValid);
            Assert.Equal(typeof(EventCodeError), eventCodeValidator.Errors.ElementAt(0).GetType());
        }
Пример #3
0
        public void InfoWithEventCodeThatHasValueAndValueNameIsValid()
        {
            var info = new Info();
            string valueName = "HSAS";
            string value = "SVR";
            var eventCode = new EventCode(valueName, value);
            info.EventCodes.Add(eventCode);

            var eventCodesValidator = new EventCodesValidator(info);
            Assert.True(eventCodesValidator.IsValid);
        }
Пример #4
0
        public void InfoWithEventCodeThatHasValueNullAndValueNameIsInvalid()
        {
            var info = new Info();
            string valueName = "HSAS";
            string value = null;
            var eventCode = new EventCode(valueName, value);
            info.EventCodes.Add(eventCode);

            var eventCodesValidator = new EventCodesValidator(info);
            Assert.False(eventCodesValidator.IsValid);
            Assert.Equal(typeof(EventCodeError), eventCodesValidator.Errors.ElementAt(0).GetType());
        }