Пример #1
0
        public void ComplexFromMethod()
        {
            var root = new RootObject
            {
            };

            object result = _expander.Expand(root, null, PropertyReference.Parse($"[{nameof(RootObjectProjection.ComplexFromMethod)}[{nameof(ChildObjectProjection.Id)},{nameof(ChildObjectProjection.Name)}]]"));

            result.ShouldNotBeNull();

            RootObjectProjection projection = result as RootObjectProjection;

            projection.ShouldNotBeNull();
            projection.ComplexFromMethod.ShouldNotBeNull();
            projection.ComplexFromMethod.Id.ShouldNotBe(Guid.Empty);
            String.IsNullOrWhiteSpace(projection.ComplexFromMethod.Name).ShouldBeFalse();
            projection.ComplexFromMethod.Name.ShouldBe(root.ComplexFromMethod().Name);
            projection.ComplexFromMethod.Description.ShouldBeNull();
        }