public EquipmentAggregateManagementService(IEquipmentAggregateRepository equipmentAggregateRepository, ILogger logger)
 {
     if (equipmentAggregateRepository == (IEquipmentAggregateRepository)null)
         throw new ArgumentNullException("equipmentAggregateRepository");
     if (logger == (ILogger)null)
         throw new ArgumentNullException("logger");
     this._equipmentAggregateRepository = equipmentAggregateRepository;
     this._logger = logger;
 }
        public void EquipmentAggregateRepositoty_GetByIdValidIdTest()
        {
            Guid guid = new Guid("602D9F0C-40DA-4FCE-8C4D-F22748D5FB2D");
            IEquipmentAggregateRepository repo      = IoCFactory.Instance.CurrentContainer.Resolve <IEquipmentAggregateRepository>();
            EquipmentAggregate            equipment = repo.GetElementById(guid);

            Assert.IsNotNull(equipment);
            Assert.IsTrue(equipment.Id == guid);
        }
 public EquipmentAggregateManagementService(IEquipmentAggregateRepository equipmentAggregateRepository, ILogger logger)
 {
     if (equipmentAggregateRepository == (IEquipmentAggregateRepository)null)
     {
         throw new ArgumentNullException("equipmentAggregateRepository");
     }
     if (logger == (ILogger)null)
     {
         throw new ArgumentNullException("logger");
     }
     this._equipmentAggregateRepository = equipmentAggregateRepository;
     this._logger = logger;
 }
        public void EquipmentAggregateRepositoty_AddTest()
        {
            IEquipmentAggregateRepository repo      = IoCFactory.Instance.CurrentContainer.Resolve <IEquipmentAggregateRepository>();
            EquipmentAggregate            equipment = new EquipmentAggregate()
            {
                Id             = Guid.NewGuid(),
                DepartmentId   = Guid.NewGuid(),
                DepartmentName = "test facility",
                Model          = "Type of equipment",
                Name           = "test equipment"
            };

            repo.Add(equipment);
            repo.UnitOfWork.Commit();
            var all = repo.GetAllElements();

            Assert.IsNotNull(all);
            Assert.IsTrue(all.Count() > 1);
        }