public void GivenValidDataRecordValue_SetsProperty() { var theValue = "The word value!"; var dataRecord = new WordDataRecord { Value = theValue }; var sut = new Word(dataRecord); var actual = sut.Value; Assert.That(actual, Is.EqualTo(theValue)); }
public Word(WordDataRecord dataRecord) { if (dataRecord == null) { throw new ArgumentNullException(nameof(dataRecord)); } if (string.IsNullOrWhiteSpace(dataRecord.Value)) { throw new ArgumentException($"The specified {dataRecord.GetType().Name} does not have a valid value.", nameof(dataRecord)); } Value = dataRecord.Value; }