public void MapPrimitive_Expected_PathToRoot() { PocoMapper pocoMapper = new PocoMapper(); IEnumerable <IPath> paths = pocoMapper.Map(1); Assert.IsTrue(paths.Any(p => p.ActualPath == PocoPath.SeperatorSymbol)); }
public void MapReferenceType_WhereGetAccessorsOfMembersThrowExceptions_Expected_PathsToExcludeThoseMembers() { PocoMapper pocoMapper = new PocoMapper(); Uri uri = new Uri("/Cake", UriKind.Relative); IEnumerable <IPath> paths = pocoMapper.Map(uri); Assert.IsFalse(paths.Any(p => p.ActualPath == "Host")); }
public void MapReferenceTypeNestedEnumerableAnWithinEnumerable_Expected_PathToPublicPrimitiveMemberOfNestedPublicEnumerableMember() { PocoTestData testData = GivenWithParallelAndNestedEnumerables(); PocoMapper pocoMapper = new PocoMapper(); IEnumerable <IPath> paths = pocoMapper.Map(testData); Assert.IsTrue(paths.Any(p => p.ActualPath == "EnumerableData().EnumerableData().Name")); }
public void MapNestedReferenceType_Expected_PathToPublicPrimitiveMemberOfNestedPublicReferenceMember() { PocoTestData testData = Given(); PocoMapper pocoMapper = new PocoMapper(); IEnumerable <IPath> paths = pocoMapper.Map(testData); Assert.IsTrue(paths.Any(p => p.ActualPath == "NestedData.Name")); }
public void MapEnumerableNestedInAnEnumerable_Expected_PathToPublicPrimitiveMemberOfEnumerableNestedInTheOuterEnumerable() { PocoMapper pocoMapper = new PocoMapper(); PocoTestData testData = GivenWithParallelAndNestedEnumerables(); IEnumerable <IPath> paths = pocoMapper.Map(testData); Assert.IsTrue(paths.Any(p => p.ActualPath == "EnumerableData().EnumerableData.Count")); }
public void MapEnumerable_Expected_PathToPublicPrimitiveMember() { PocoMapper pocoMapper = new PocoMapper(); List <int> primitives = new List <int>(); IEnumerable <IPath> paths = pocoMapper.Map(primitives); Assert.IsTrue(paths.Any(p => p.ActualPath == "Count")); }
public void MapEnumerable_Expected_PathToEnumerable() { var pocoMapper = new PocoMapper(); var testData = GivenWithParallelAndNestedEnumerables(); var paths = pocoMapper.Map(testData.EnumerableData); Assert.IsTrue(paths.Any(p => p.ActualPath == "UnnamedArray().Name")); }
public void MapReferenceTypeNestedInAnWithinEnumerable_Expected_PathToPublicPrimitiveMemberOfPublicReferenceMemberOfPublicEnumerableMember() { var testData = Given(); var pocoMapper = new PocoMapper(); var paths = pocoMapper.Map(testData); Assert.IsTrue(paths.Any(p => p.ActualPath == "EnumerableData().NestedData.Name")); }
public void MapReferenceType_Expected_PathToPublicPrimitiveMemberOfPublicReferenceMember() { var testData = Given(); var pocoMapper = new PocoMapper(); var paths = pocoMapper.Map(testData); Assert.IsTrue(paths.Any(p => p.ActualPath == "Name")); }
public void MapEnumerableOnlyContainingPrimitives_Expected_PathToRoot() { PocoMapper pocoMapper = new PocoMapper(); List <int> primitives = new List <int> { 1, 2, 3 }; IEnumerable <IPath> paths = pocoMapper.Map(primitives); Assert.IsTrue(paths.Any(p => p.ActualPath == PocoPath.EnumerableSymbol + PocoPath.SeperatorSymbol)); }
public void MapEnumerableOnlyContainingPrimitives_Expected_PathToRoot() { var pocoMapper = new PocoMapper(); var primitives = new List <int> { 1, 2, 3 }; var paths = pocoMapper.Map(primitives); Assert.IsTrue(paths.Any(p => p.ActualPath == "Capacity" || p.ActualPath == "Count")); }