public void MarcRecordUtiltity_RemoveField_1() { MarcRecord record = new MarcRecord(); MarcRecord result = record.RemoveField(700); Assert.AreSame(record, result); record.AddField(700, "^aСидоров^bС. С."); result = record.RemoveField(700); Assert.AreSame(record, result); record.AddField(200, "^aЗаглавие"); record.AddField(700, "^aИванов^bИ. И."); record.AddField(700, "^aПетров^bП. П."); record.AddField(700, "^aСидоров^bС. С."); result = record.RemoveField(700); Assert.AreSame(record, result); Assert.AreEqual(1, record.Fields.Count); }
public void MarcRecordUtility_ReplaceField_2() { MarcRecord record = new MarcRecord(); RecordField[] replacement = { new RecordField(702, "^aИванов^bИ. И."), new RecordField(702, "^aПетров^bП. П."), new RecordField(702, "^aСидоров^bС. С."), }; record.AddField(700, "^aСидоров^bС. С."); MarcRecord result = record.RemoveField(700); Assert.AreSame(record, result); result = record.ReplaceField(700, replacement); Assert.AreSame(record, result); Assert.AreEqual(3, record.Fields.Count); Assert.IsFalse(record.HaveField(700)); Assert.IsTrue(record.HaveField(702)); }