Пример #1
0
        public void FromApiNodePermissions_Null()
        {
            // ARRANGE
            NodePermissions expected = null;

            ApiNodePermissions param = null;

            // ACT
            NodePermissions actual = NodeMapper.FromApiNodePermissions(param);

            // ASSERT
            Assert.Equal(expected, actual, new NodePermissionsComparer());
        }
Пример #2
0
        public void FromApiNodePermissions()
        {
            // ARRANGE
            NodePermissions expected = FactoryNode.NodePermissions;

            ApiNodePermissions param = new ApiNodePermissions {
                Manage = expected.Manage,
                Read   = expected.Read,
                Create = expected.Create,
                Change = expected.Change,
                Delete = expected.Delete,
                ManageDownloadShare = expected.ManageDownloadShare,
                ManageUploadShare   = expected.ManageUploadShare,
                ReadRecycleBin      = expected.CanReadRecycleBin,
                RestoreRecycleBin   = expected.CanRestoreRecycleBin,
                DeleteRecycleBin    = expected.CanDeleteRecycleBin
            };

            // ACT
            NodePermissions actual = NodeMapper.FromApiNodePermissions(param);

            // ASSERT
            Assert.Equal(expected, actual, new NodePermissionsComparer());
        }