Esempio n. 1
0
        public async Task Should_Not_Find_User()
        {
            await using (var context = new DbContextFactory().CreateContext())
            {
                var service = new BankingServiceFactory().Create(context);

                FluentActions.Invoking(async() =>
                                       await service.AddBankAccount(new AddBankAccountBody()
                {
                    UserId = new Guid()
                }))
                .Should().Throw <UserNotFoundException>();
            }
        }
Esempio n. 2
0
        public async Task Should_Create_Account_If_Null()
        {
            await using (var context = new DbContextFactory().CreateContext())
            {
                var service = new BankingServiceFactory().Create(context);

                var result = service.AddBankAccount(new AddBankAccountBody()
                {
                    UserId    = userId,
                    BankToken = "btok_gb"
                });
                result.Should().NotBeNull();
                var user = context.Users.First(x => x.Id == userId);
                user.StripeAccountId.Should().NotBeNull();
            }
        }