public void GivenRepeatingSimpleType_Map_ReturnsRepeating() { var uut = new TagToPropertyMapper(new SubPropertySetterFactory()); uut.Map <TestTypeParent>(); uut.TryGet(56.ToKnownTag(), typeof(TestTypeParent).GetHashCode(), out TagMapLeaf repeatingTag); uut.TryGet(57.ToKnownTag(), typeof(TestTypeParent).GetHashCode(), out TagMapLeaf actualTag); Assert.False(repeatingTag.IsEncoded); Assert.False(repeatingTag.IsEnumerable); Assert.NotNull(repeatingTag.Current); Assert.Null(repeatingTag.Parents); Assert.Null(repeatingTag.TypeConverterName); Assert.False(actualTag.IsEncoded); Assert.True(actualTag.IsEnumerable); Assert.NotNull(actualTag.Current); Assert.Null(actualTag.Parents); Assert.NotEqual(0, actualTag.RepeatingTagNumber); }
public void GivenSimpleTag_Map_ReturnsTagWithNoParents() { var uut = new TagToPropertyMapper(new SubPropertySetterFactory()); uut.Map <TestTypeParent>(); uut.TryGet(55.ToKnownTag(), typeof(TestTypeParent).GetHashCode(), out TagMapLeaf result); Assert.False(result.IsEncoded); Assert.False(result.IsEnumerable); Assert.NotNull(result.Current); Assert.Null(result.Parents); }
public void GivenComplexChildType_Map_ReturnsChildsTag() { var uut = new TagToPropertyMapper(new SubPropertySetterFactory()); uut.Map <TestTypeParent>(); uut.TryGet(58.ToKnownTag(), typeof(TestTypeParent).GetHashCode(), out TagMapLeaf result); Assert.False(result.IsEncoded); Assert.False(result.IsEnumerable); Assert.NotNull(result.Current); Assert.Single(result.Parents); Assert.False(result.Parents.First().IsEnumerable); }