Esempio n. 1
0
        public virtual void testQueryList()
        {
            // given
            authRule.CreateGrantAuthorization(Resources.Batch, batch1.Id, "user", Permissions.Read);

            // when
            authRule.EnableAuthorization("user");
            IList <IBatch> batches = engineRule.ManagementService.CreateBatchQuery()
                                     .ToList();

            authRule.DisableAuthorization();

            // then
            Assert.AreEqual(1, batches.Count);
            Assert.AreEqual(batch1.Id, batches[0].Id);
        }
        public virtual void testQueryList()
        {
            // given
            authRule.CreateGrantAuthorization(Resources.Batch, batch1.Id, "user", Permissions.Read);

            // when
            authRule.EnableAuthorization("user");
            IList <IBatchStatistics> batches = engineRule.ManagementService.CreateBatchStatisticsQuery().ToList();

            authRule.DisableAuthorization();

            // then
            Assert.AreEqual(1, batches.Count);
            Assert.AreEqual(batch1.Id, batches[0].Id);

            // and the visibility of jobs is not restricted
            Assert.AreEqual(1, batches[0].JobsCreated);
            Assert.AreEqual(1, batches[0].RemainingJobs);
            Assert.AreEqual(1, batches[0].TotalJobs);
        }