Exemple #1
0
        private void MockGetOpenArtifactPermissions(IEnumerable <OpenArtifactPermission> mockOpenArtifactPermissionsResult, SqlConnectionWrapperMock cxn, IEnumerable <int> projectArtifactIds, int revisionId = int.MaxValue, bool addDrafts = true)
        {
            var artifactIds = SqlConnectionWrapper.ToDataTable(projectArtifactIds, "Int32Collection", "Int32Value");

            cxn.SetupQueryAsync("GetOpenArtifactPermissions",
                                new Dictionary <string, object>
            {
                { "userId", 0 },
                { "artifactIds", artifactIds }
            }, mockOpenArtifactPermissionsResult);
        }
Exemple #2
0
        private void MockToReturnInstanceAdmin(bool isInstanceAdmin, SqlConnectionWrapperMock cxn)
        {
            var result = new List <bool> {
                isInstanceAdmin
            };

            cxn.SetupQueryAsync("IsInstanceAdmin",
                                new Dictionary <string, object> {
                { "contextUser", false }, { "userId", 0 }
            }, result);
        }