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