Exemple #1
0
        public EntityService(
            Notificator notificator,
            IFetchingRecords source,
            ICreatingRecords creator,
            IUpdatingRecords updater,
            IDeletingRecords deleter)
        {
            if (notificator == null)
            {
                throw new ArgumentNullException("notificator");
            }
            if (source == null)
            {
                throw new ArgumentNullException("source");
            }
            if (creator == null)
            {
                throw new ArgumentNullException("creator");
            }
            if (updater == null)
            {
                throw new ArgumentNullException("updater");
            }
            if (deleter == null)
            {
                throw new ArgumentNullException("deleter");
            }

            _notificator = notificator;
            _source      = source;
            _creator     = creator;
            _updater     = updater;
            _deleter     = deleter;
        }
 public RecordsUpdater_()
 {
     _source = new RecordsSource(_admin, new Notificator());
     _user = A.Fake<IProvidingUser>();
     A.CallTo(() => _user.CurrentUserName()).Returns("Test");
     var executor = new DbCommandExecutor(_admin, _user);
     _updater = new RecordsUpdater(_admin, executor, _source, _user);
 }
Exemple #3
0
        public EntityService(
            Notificator notificator,
            IFetchingRecords source,
            ICreatingRecords creator,
            IUpdatingRecords updater,
            IDeletingRecords deleter,
            IComparingRecords comparer,
            IDescribingChanges changeDescriber,
            IHandlingFiles filesHandler,
            IValidatingEntities validator)
        {
            if (notificator == null)
            {
                throw new ArgumentNullException("notificator");
            }
            if (source == null)
            {
                throw new ArgumentNullException("source");
            }
            if (creator == null)
            {
                throw new ArgumentNullException("creator");
            }
            if (updater == null)
            {
                throw new ArgumentNullException("updater");
            }
            if (deleter == null)
            {
                throw new ArgumentNullException("deleter");
            }
            if (comparer == null)
            {
                throw new ArgumentNullException("comparer");
            }
            if (changeDescriber == null)
            {
                throw new ArgumentNullException("changeDescriber");
            }
            if (filesHandler == null)
            {
                throw new ArgumentNullException("filesHandler");
            }
            if (validator == null)
            {
                throw new ArgumentNullException("validator");
            }

            _notificator     = notificator;
            _source          = source;
            _creator         = creator;
            _updater         = updater;
            _deleter         = deleter;
            _comparer        = comparer;
            _changeDescriber = changeDescriber;
            _filesHandler    = filesHandler;
            _validator       = validator;
        }
        public RecordsUpdater_ManyToMany()
        {
            _source = new RecordsSource(_admin, new Notificator());
            _user   = A.Fake <IProvidingUser>();
            A.CallTo(() => _user.CurrentUserName()).Returns("Test");
            var executor = new DbCommandExecutor(_admin, _user);

            _updater = new RecordsUpdater(_admin, executor, _source, _user);
        }
        public RecordsUpdater_()
        {
            _source = new RecordsSource(new Notificator());
            _user = A.Fake<IProvidingUser>();
            A.CallTo(() => _user.Current()).Returns("Test");
            var executor = new DbCommandExecutor(_user);
            _updater = new RecordsUpdater(executor, _source);
            Admin.AddEntity<Product>();
            Admin.SetForeignKeysReferences();
            Admin.ConnectionStringName = ConnectionStringName;

            _productId = DB.Products.Insert(ProductName: "Product").ProductID;
            _entity = _source.GetEntityWithData(Admin.GetEntity("Product"), _productId.ToString());
        }
        public RecordsUpdater_()
        {
            _source = new RecordsSource(new Notificator());
            _user   = A.Fake <IProvidingUser>();
            A.CallTo(() => _user.Current()).Returns("Test");
            var executor = new DbCommandExecutor(_user);

            _updater = new RecordsUpdater(executor, _source);
            Admin.AddEntity <Product>();
            Admin.SetForeignKeysReferences();
            Admin.ConnectionStringName = ConnectionStringName;

            _productId = DB.Products.Insert(ProductName: "Product").ProductID;
            _entity    = _source.GetEntityWithData(Admin.GetEntity("Product"), _productId.ToString());
        }
        public EntityService(
            Notificator notificator,
            IFetchingRecords source,
            ICreatingRecords creator,
            IUpdatingRecords updater,
            IDeletingRecords deleter,
            IComparingRecords comparer,
            IDescribingChanges changeDescriber,
            IHandlingFiles filesHandler,
            IValidatingEntities validator)
        {
            if (notificator == null)
                throw new ArgumentNullException("notificator");
            if (source == null)
                throw new ArgumentNullException("source");
            if (creator == null)
                throw new ArgumentNullException("creator");
            if (updater == null)
                throw new ArgumentNullException("updater");
            if (deleter == null)
                throw new ArgumentNullException("deleter");
            if (comparer == null)
                throw new ArgumentNullException("comparer");
            if (changeDescriber == null)
                throw new ArgumentNullException("changeDescriber");
            if (filesHandler == null)
                throw new ArgumentNullException("filesHandler");
            if (validator == null)
                throw new ArgumentNullException("validator");

            _notificator = notificator;
            _source = source;
            _creator = creator;
            _updater = updater;
            _deleter = deleter;
            _comparer = comparer;
            _changeDescriber = changeDescriber;
            _filesHandler = filesHandler;
            _validator = validator;
        }
Exemple #8
0
        public EntityService(
            Notificator notificator,
            IFetchingRecords source,
            ICreatingRecords creator,
            IUpdatingRecords updater,
            IDeletingRecords deleter)
        {
            if (notificator == null)
                throw new ArgumentNullException("notificator");
            if (source == null)
                throw new ArgumentNullException("source");
            if (creator == null)
                throw new ArgumentNullException("creator");
            if (updater == null)
                throw new ArgumentNullException("updater");
            if (deleter == null)
                throw new ArgumentNullException("deleter");

            _notificator = notificator;
            _source = source;
            _creator = creator;
            _updater = updater;
            _deleter = deleter;
        }