public static async Task CheckNotificationResponse(
     this HttpResponseMessage response,
     TestServiceScope scope,
     params ApplicationUser[] recipientUsers)
 {
     await response.CheckNotificationResponse(scope, recipientUsers.Length);
 }
        private async Task CheckOrderCreatedAsync(TestServiceScope scope, Registration reg, params Product[] products)
        {
            var order = await scope.Db.Orders
                        .AsNoTracking()
                        .Include(o => o.OrderLines)
                        .SingleAsync(o => o.RegistrationId == reg.RegistrationId);

            Assert.Equal(products.Length, order.OrderLines.Count);
            Assert.All(order.OrderLines, line => Assert.Contains(products, p => p.ProductId == line.ProductId));
        }
        private async Task <Registration> LoadAndCheckAsync(TestServiceScope scope, Registration registration, Action <Registration> check)
        {
            var updated = await scope.Db.Registrations
                          .AsNoTracking()
                          .SingleAsync(r =>
                                       r.RegistrationId == registration.RegistrationId);

            check(updated);
            return(updated);
        }
        public static async Task CheckNotificationResponse(
            this HttpResponseMessage response,
            TestServiceScope scope,
            int totalRecipients,
            int?totalSent   = null,
            int?totalErrors = null)
        {
            var token = await response.CheckOk().AsTokenAsync();

            token.CheckNotification(await scope.Db.Notifications
                                    .AsNoTracking()
                                    .OrderBy(n => n.Created)
                                    .LastAsync(),
                                    totalSent ?? totalRecipients,
                                    totalErrors ?? 0,
                                    totalRecipients);
        }
示例#5
0
 public void Dispose()
 {
     TestServiceScope.Dispose();
 }