// ACT public override void Act(out object[] actual) { // Get 1st line var first_line = new PrivateProfileLine(this.RawLines[0]); // Get Null Section Flag var null_section = (first_line.LineType != PrivateProfileLineType.Section); // NEW Lines var lines = new PrivateProfileLine[this.RawLines.Length + (null_section ? 1 : 0)]; // Add Null Section Line if (null_section) { lines[0] = new PrivateProfileLine(null); } // for Lines for (int i = (null_section ? 1 : 0); i < lines.Length; i++) { // NEW Line lines[i] = new PrivateProfileLine(this.RawLines[i - (null_section ? 1 : 0)]); } // ACT: NEW Section var section = new PrivateProfileSection(lines); // GET Actual actual = SectionTestParameter.ConvertSectionToObjectArray(section); }
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(); }
// ACT public override void Act(out object[] actual) { // ACT: Append NEW Line this.Section.Update(this.Key, this.NewValue); // GET Actual actual = SectionTestParameter.ConvertSectionToObjectArray(this.Section); }
// ACT public override void Act(out object[] actual) { // ACT: Append NEW Line this.Section.Append(new PrivateProfileLine(this.NewLine)); // GET Actual actual = SectionTestParameter.ConvertSectionToObjectArray(this.Section); }
// ACT public override void Act(out object[] actual) { // ACT: Change Section Name this.Section.Name = this.Name; // GET Actual actual = SectionTestParameter.ConvertSectionToObjectArray(this.Section); }
// ACT public override void Act(out object[] actual) { // ACT: NEW Section var section = new PrivateProfileSection(this.RawLines); // GET Actual actual = SectionTestParameter.ConvertSectionToObjectArray(section); }
// ACT public override void Act(out object[] actual) { // ACT: Append NEW Line this.result = this.Section.Remove(this.Key); // Print return value of Remove() method Console.WriteLine($"Return value of Remove() method = {this.result}"); // GET Actual actual = SectionTestParameter.ConvertSectionToObjectArray(this.Section); }