Ejemplo n.º 1
0
        private object SearchWageringConfigurations(SearchPackage searchPackage)
        {
            var brandFilterSelections = _adminQueries.GetBrandFilterSelections();
            var wagerConfigurations   = _wagerConfigurationQueries.GetWagerConfigurations()
                                        .Where(x => brandFilterSelections.Contains(x.BrandId));

            var dataBuilder = new SearchPackageDataBuilder <WagerConfigurationDTO>(searchPackage, wagerConfigurations);

            dataBuilder
            .Map(wager => wager.Id.ToString(),
                 wager => new[]
            {
                _brandQueries.GetBrandOrNull(wager.BrandId).Licensee.Name,
                _brandQueries.GetBrandOrNull(wager.BrandId).Name,
                wager.Currency,
                wager.Status,
                wager.IsActive,
                wager.ActivatedBy.ToString(),
                wager.DateActivated == null ? null : Format.FormatDate(wager.DateActivated, false),
                wager.DeactivatedBy.ToString(),
                wager.DateDeactivated == null ? null : Format.FormatDate(wager.DateDeactivated, false),
                wager.CreatedBy.ToString(),
                Format.FormatDate(wager.DateCreated, false),
                wager.UpdatedBy.ToString(),
                wager.DateUpdated == null ? null : Format.FormatDate(wager.DateUpdated, false)
            }
                 );

            return(dataBuilder.GetPageData(walletTemplate => walletTemplate.DateCreated));
        }
Ejemplo n.º 2
0
        public void Cannot_execute_WagerConfigurationQueries_without_permissions()
        {
            // Arrange
            LogWithNewAdmin(Modules.WagerConfiguration, Permissions.Create);

            // Act
            Assert.Throws <InsufficientPermissionsException>(() => _wagerConfigurationQueries.GetWagerConfigurations());
        }