public void Collect_types_of_hierarchy() { var types = Flatten_non_scalar_field_by_field.Collect_type_hierarchy(typeof(Derived_with_different_visibilities)); Assert.AreEqual(new[] { typeof(Derived_with_different_visibilities), typeof(Different_field_visibilities), typeof(object) }, types.ToArray()); }
public void Initialize() { _sut = new Flatten_non_scalar_field_by_field(); _sut.MetaObject += _ => _metaFragments.Add(_); _sut.FieldValue += _ => _fragments.Add(_); _metaFragments = new List <object>(); _fragments = new List <object>(); }
public void Collect_fields_of_derived_type() { var fields = Flatten_non_scalar_field_by_field.Collect_fields(new Derived_with_different_visibilities()); Assert.AreEqual(7, fields.Count()); }
public void Collect_fields_of_base_type() { var fields = Flatten_non_scalar_field_by_field.Collect_fields(new Different_field_visibilities()); Assert.AreEqual(5, fields.Count()); }