コード例 #1
0
        public async Task <IActionResult> OnGetAsync()
        {
            var personEntity = new Faker <Entities.Person>()
                               .RuleFor(u => u.FirstName, (f, u) => f.Name.FirstName())
                               .RuleFor(u => u.LastName, (f, u) => f.Name.LastName())
                               .RuleFor(u => u.Id, (f, u) => Guid.NewGuid())
                               .RuleFor(u => u.Created, (f, u) => DateTime.Now)
                               .Generate();

            _applicationDbContext.Persons.Add(personEntity);
            _applicationDbContext.SaveChanges();
            await _webhookPublisher.Publish(Enums.WebHookEvents.PersonCreated, personEntity);

            return(Page());
        }
コード例 #2
0
        public void Should_Not_Send_Webhook_If_There_Is_Subscription_Sync()
        {
            CreateTenantAndSubscribeToWebhook(
                AppWebhookDefinitionNames.Users.Created,
                AppFeatures.WebhookFeature,
                "true"
                );

            AbpSession.TenantId = GetDefaultTenant().Id;
            _webhookPublisher.Publish(AppWebhookDefinitionNames.Test,
                                      new
            {
                Name    = "Musa",
                Surname = "Demir"
            });

            _backgroundJobManagerSubstitute.DidNotReceive()
            .Enqueue <WebhookSenderJob, WebhookSenderArgs>(Arg.Any <WebhookSenderArgs>());
        }