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()); }
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(NamedValueError <EventCode>), eventCodesValidator.Errors.ElementAt(0).GetType()); }