コード例 #1
0
        public void ToStringOnEnumerableSegment_WhereEnumerablesArentConsidered_Expected_ScalarFormat()
        {
            PocoPath     path    = new PocoPath();
            IPathSegment segment = path.CreatePathSegment("Collection()");

            const string expected = "Collection";
            string       actual   = segment.ToString(false);

            Assert.AreEqual(expected, actual);
        }
コード例 #2
0
        public void CreateEnumerablePathSegmentFromSegmentText_Expected_EnumerablePocoPathSegment()
        {
            PocoPath     path    = new PocoPath();
            IPathSegment segment = path.CreatePathSegment("EnumerableData()");

            bool expected = true;
            bool actual   = segment.IsEnumarable;

            Assert.AreEqual(expected, actual);
        }
コード例 #3
0
        public void CreateScalarPathSegmentFromSegmentText_Expected_ScalarPocoPathSegment()
        {
            PocoPath     path    = new PocoPath();
            IPathSegment segment = path.CreatePathSegment("Name");

            bool expected = false;
            bool actual   = segment.IsEnumarable;

            Assert.AreEqual(expected, actual);
        }
コード例 #4
0
        public void ToStringOnScalarSegmentt_WhereEnumerablesAreConsidered__Expected_ScalarFormat()
        {
            PocoPath     path    = new PocoPath();
            IPathSegment segment = path.CreatePathSegment("Name");

            const string expected = "Name";
            string       actual   = segment.ToString(true);

            Assert.AreEqual(expected, actual);
        }
コード例 #5
0
        public void ToStringOnEnumerableSegment_Expected_EnumerableFormat()
        {
            PocoPath     path    = new PocoPath();
            IPathSegment segment = path.CreatePathSegment("Collection()");

            const string expected = "Collection()";
            string       actual   = segment.ToString();

            Assert.AreEqual(expected, actual);
        }
コード例 #6
0
        public void ToStringOnScalarSegment_Expected_ScalarFormat()
        {
            PocoPath     path    = new PocoPath();
            IPathSegment segment = path.CreatePathSegment("Name");

            string expected = "Name";
            string actual   = segment.ToString();

            Assert.AreEqual(expected, actual);
        }
コード例 #7
0
        public void ToStringOnScalarSegment_WhereEnumerablesArentConsidered__Expected_ScalarFormat()
        {
            var path    = new PocoPath();
            var segment = path.CreatePathSegment("Name");

            const string expected = "Name";
            var          actual   = segment.ToString(false);

            Assert.AreEqual(expected, actual);
        }
コード例 #8
0
        public void ToStringOnEnumerableSegment_WhereEnumerablesAreConsidered_Expected_ScalarFormat()
        {
            var path    = new PocoPath();
            var segment = path.CreatePathSegment("Collection()");

            const string expected = "Collection()";
            var          actual   = segment.ToString(true);

            Assert.AreEqual(expected, actual);
        }
コード例 #9
0
        public void CreateScalarPathSegmentFromPropertyInfo_Expected_ScalarPocoPathSegment()
        {
            PropertyInfo propertyInfo = typeof(PocoTestData).GetProperty("Name");
            PocoPath     path         = new PocoPath();
            IPathSegment segment      = path.CreatePathSegment(propertyInfo);

            bool expected = false;
            bool actual   = segment.IsEnumarable;

            Assert.AreEqual(expected, actual);
        }
コード例 #10
0
        public void CreateScalarPathSegmentFromPropertyInfo_Expected_ScalarPocoPathSegment()
        {
            var propertyInfo = typeof(PocoTestData).GetProperty("Name");
            var path         = new PocoPath();
            var segment      = path.CreatePathSegment(propertyInfo.Name, propertyInfo.PropertyType.IsEnumerable());

            const bool expected = false;
            var        actual   = segment.IsEnumarable;

            Assert.AreEqual(expected, actual);
        }
コード例 #11
0
        public void CreateEnumerablePathSegmentFromPropertyInfo_Expected_EnumerablePocoPathSegment()
        {
            PropertyInfo propertyInfo = typeof(PocoTestData).GetProperty("EnumerableData");
            PocoPath     path         = new PocoPath();
            IPathSegment segment      = path.CreatePathSegment(propertyInfo.Name, propertyInfo.PropertyType.IsEnumerable());

            const bool expected = true;
            bool       actual   = segment.IsEnumarable;

            Assert.AreEqual(expected, actual);
        }