public void EventCodeWithValueAndValueNameIsValid() { string value = "SVR"; string valueName = "HSAS"; var eventCode = new EventCode(value, valueName); var eventCodeValidator = new EventCodeValidator(eventCode); Assert.True(eventCodeValidator.IsValid); }
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()); }