public void IgnoreDuplicatedEntryPropertyExceptionTest() { // New Section var section = new PrivateProfileSection { Name = "Test" }; // Append Entry section.Append(new PrivateProfileLine() { Key = "Key", Value = "Value" }); // Append Another Entry section.Append(new PrivateProfileLine() { Key = "Key1", Value = "Value1" }); // Append Same Entry (Exception) section.Append(new PrivateProfileLine() { Key = "Key", Value = "Value2" }); }
public override void Act(out object[] actual) { // New Section (ignoreDuplicatedEntry = true) var section = new PrivateProfileSection(true) { Name = this.Name }; // Append Entries foreach (var entry in this.Entries) { section.Append(new PrivateProfileLine() { Key = entry[0], Value = entry[1] }); } // Get Actual actual = SectionTestParameter.ConvertSectionToObjectArray(section); // Override Expected Length by Reming Entry var list = this.Entries.ToList(); list.RemoveAt(2); (this.Expected as object[])[1] = list.ToArray(); }