コード例 #1
0
        public void GetModelByNameTest()
        {
            var model = MDSWrapper.GetModelByName(modelName, global::Common.MDSService.ResultType.Identifiers);

            Trace.Write(model.Identifier.Name);
            Assert.IsNotNull(model);
            Assert.IsTrue(model.Identifier.Name.Equals(modelName));
        }
コード例 #2
0
        public void UserSecurityPrincipalsGet()
        {
            var model        = MDSWrapper.GetModelByName(modelName, global::Common.MDSService.ResultType.Identifiers);
            var userToExport = MDSWrapper.UserSecurityPrincipalsGet(UserToExport);

            Assert.IsTrue(userToExport != null);
            Assert.IsTrue(userToExport.Users.Count == 1);
            Assert.IsTrue(userToExport.Users.FirstOrDefault().Identifier.Name.Equals(UserToExport, StringComparison.InvariantCultureIgnoreCase));
        }
コード例 #3
0
        public void ExportSecurityPrivilegesTest()
        {
            var model = MDSWrapper.GetModelByName(modelName, global::Common.MDSService.ResultType.Identifiers);

            var userToExport = MDSWrapper.UserSecurityPrincipalsGet(UserToExport);

            Assert.IsTrue(userToExport != null && userToExport.Users.Any(), "No security principals returned! Connection: " + MDSWrapper.Configuration.EndpointAddress);

            var fileName = String.Format(global::Common.Constants.StringFormatUserPrivileges, userToExport.Users.FirstOrDefault().Identifier.Id);

            MDSWrapper.SecurityPrivilegesExport(model.Identifier, folderToExport, fileName, userToExport.Users.FirstOrDefault());

            Assert.IsTrue(File.Exists(Path.Combine(folderToExport, fileName)));
            //File.Delete(Path.Combine(folderToExport, fileName));
        }