Beispiel #1
0
        public void CanUpdateRecord()
        {
            const string previousValue  = "Test 1";
            const string newValue       = "Test 2";
            var          fileCollection = new SimpleFileCollection <RecordStub>();
            var          testRecord     = new RecordStub {
                TestValue = previousValue
            };

            fileCollection.Add(testRecord);
            var addedRecord = fileCollection.SingleOrDefault(Matches(testRecord));

            addedRecord.TestValue.ShouldBe(previousValue);

            testRecord.TestValue = newValue;
            fileCollection.Update(testRecord);
            var updatedRecord = fileCollection.SingleOrDefault(Matches(testRecord));

            updatedRecord.TestValue.ShouldBe(newValue);
        }