Esempio n. 1
0
        public async Task ServiceReadsAccountIfOneExists()
        {
            //Arrange
            string  serviceId       = "serviceId";
            Account originalAccount = await DefaultAccountFactoryService.CreateDefaultAccountAsync(serviceId);

            //Act
            var account = await AccountFacadeService.ReadOrCreateAccountAsync(originalAccount.ServiceId);

            //Assert
            Assert.IsNotNull(account);
            Assert.AreEqual(originalAccount.Id, account.Id);
        }
Esempio n. 2
0
        public async Task ServiceCreatesAnAccountIfItIsNot()
        {
            //Arrange
            string serviceId = "someServiceId";
            //Act
            var account = await AccountFacadeService.ReadOrCreateAccountAsync(serviceId);

            var account1 = await Context.Accounts
                           .Where(acc => acc.ServiceId == serviceId)
                           .SingleAsync();

            //Assert
            Assert.IsNotNull(account);
            Assert.IsNotNull(account1);
        }