Exemplo n.º 1
0
        public void projection_does_not_include_not_authorized_columns()
        {
            var grid = new TargetGrid();

            grid.Column(x => x.Count);
            grid.Column(x => x.Name);
            grid.Column(x => x.IsCool);

            var service = new StubFieldAccessService();

            service.SetRights <GridDefTarget>(x => x.Count, AccessRight.ReadOnly);
            service.SetRights <GridDefTarget>(x => x.Name, AccessRight.None);

            var projection = grid.ToProjection(service);

            projection.As <IProjection <GridDefTarget> >().Accessors()
            .Select(x => x.Name)
            .ShouldHaveTheSameElementsAs("Count", "IsCool");
        }