Example #1
0
        public async Task ReturnWallet_When_PassedCorrectParams()
        {
            //Arrange
            contextOptions = new DbContextOptionsBuilder <ItsAllAboutTheGameDbContext>()
                             .UseInMemoryDatabase(databaseName: "ReturnWallet_When_PassedCorrectParams")
                             .Options;

            foreignExchangeServiceMock = new Mock <IForeignExchangeService>();

            dateTimeProvider = new DateTimeProvider();

            //Act & Assert

            using (var actContext = new ItsAllAboutTheGameDbContext(contextOptions))
            {
                var walletService  = new WalletService(actContext, foreignExchangeServiceMock.Object, dateTimeProvider);
                var walletToCreate = await walletService.CreateUserWallet(Currency.GBP);

                Assert.IsInstanceOfType(walletToCreate, typeof(Wallet));
            }
        }