Пример #1
0
        public void SaveEntity()
        {
            var factory = new Data.RepositoryFactory();
            Business.User userBiz = new Business.User(factory);

            var userNew = FakeEntities.Generator.CreateUser();
            var creditCardTypeNew = FakeEntities.Generator.CreateCreditCardType();
            var creditCardNew = FakeEntities.Generator.CreateCreditCard(creditCardTypeNew, userNew);

            var userSaved = userBiz.Save(userNew);

            Assert.IsNotNull(userSaved);
        }
Пример #2
0
        public void DeleteEntity()
        {
            var factory = new Data.RepositoryFactory();
            Business.User userBiz = new Business.User(factory);

            var userFound = userBiz.Get(1);

            if (userFound == null)
                userFound = userBiz.Save(FakeEntities.Generator.CreateUser());

            int id = userFound.Id;

            userBiz.Delete(userFound);

            var userDeleted = userBiz.Get(id);

            Assert.IsNull(userDeleted);
        }