public void Table_AsColumn() { // Tables are usable as Columns, allowing nesting a full table of columns as a single named column. // Test Table ILimitedList members by using the Column.Basics testing. V1.PersonDatabase db = new V1.PersonDatabase(); V1.PersonTable other = db.Person; V1.Person defaultPerson = new Person(other); V1.Person nonDefaultPerson = new Person(other) { Age = 39, Name = "Scott" }; Column.Basics <V1.Person>( () => new PersonTable(new PersonDatabase()), defaultPerson, nonDefaultPerson, (i) => new Person(other) { Age = (byte)(i % byte.MaxValue) } ); // Set to already correct instance string name = other[1].Name; other[1] = other[1]; Assert.Equal(name, other[1].Name); // Verify Add detects already is last Table item int count = other.Count; other.Add(other[count - 1]); Assert.Equal(count, other.Count); }
internal Person(PersonTable table) : this(table, table.Add()._index) { Init(); }
internal Person(PersonTable table) : this(table, table.Count) { table.Add(); }