Esempio n. 1
0
            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));
            }
Esempio n. 2
0
 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;
 }