Exemple #1
0
            public void WithAllDepdenciesNotNullShouldNotFail()
            {
                ITaskRepository       taskRepo    = Substitute.For <ITaskRepository>();
                ISystemInfoRepository sysInfoRepo = Substitute.For <ISystemInfoRepository>();

                Assert.That(() => new LoadLandingPageData(taskRepo, sysInfoRepo),
                            Throws.Nothing);
            }
Exemple #2
0
            public void WithNullTaskRepoShouldThrowException()
            {
                ITaskRepository       taskRepo    = null;
                ISystemInfoRepository sysInfoRepo = null;

                Assert.That(() => new LoadLandingPageData(taskRepo, sysInfoRepo),
                            Throws.ArgumentNullException.With.Message.Contains("taskRepo"));
            }
        public DataCollectSrv()
        {
            uProcessId = "";
            //BinaryFile based==> initialize device info repository!!!! and get all listed devices !!!!!
            _dataInfoRepository = new SystemInfoRepository("ExcaliburSystemReport");
            _data = new ObservableCollection <SystemInfoModel>(_dataInfoRepository.GetAllData());

            FullDataReport = new SystemInfoModel();
            FullDataReport.DeviceDriverDataList = new List <DeviceManagerDataModel>();
            FullDataReport.ModuleDataList       = new List <ModuleDataModel>();
            FullDataReport.osDataModel          = new OsDataModel();


            Init();
        }
Exemple #4
0
            public void WithOneUserAndNoTasks()
            {
                ITaskRepository taskRepo = Substitute.For <ITaskRepository>();

                taskRepo.GetTotalCount().Returns(0);
                taskRepo.GetTasksFor(Arg.Any <User>())
                .Returns(new HashSet <Core.Model.Task>());

                ISystemInfoRepository sysInfoRepo = Substitute.For <ISystemInfoRepository>();

                sysInfoRepo.GetActiveUsers().Returns(1);

                LoadLandingPageData useCase = new LoadLandingPageData(taskRepo, sysInfoRepo);
                User theUser = new User {
                    Username = "******"
                };

                LandingPageData data = useCase.GetData(theUser);

                Assert.That(data.ActiveUsers, Is.EqualTo(1));
                Assert.That(data.TotalTasks, Is.EqualTo(0));
                Assert.That(data.UserTasks, Has.Count.EqualTo(0));
            }
Exemple #5
0
 public SystemInfoServices(ISystemInfoRepository dal)
 {
     this.dal     = dal;
     base.baseDal = dal;
 }
Exemple #6
0
 public LoadLandingPageData(ITaskRepository taskRepo, ISystemInfoRepository sysInfoRepo)
 {
     this.taskRepo    = taskRepo ?? throw new ArgumentNullException(nameof(taskRepo));
     this.sysInfoRepo = sysInfoRepo ?? throw new ArgumentNullException(nameof(sysInfoRepo));
 }
Exemple #7
0
 public SystemInfoApplicationService(ILogManager logManager, ISystemInfoRepository systemInfoRepository)
 {
     _logManager           = logManager;
     _systemInfoRepository = systemInfoRepository;
 }
 public DataSyncSettingAllStateGrain(ISystemInfoRepository systemInfoRepository, ITableInfoRepository tableInfoRepository, IColumnInfoRepository columnInfoRepository)
 {
     _columnInfoRepository = columnInfoRepository;
     _tableInfoRepository  = tableInfoRepository;
     _systemInfoRepository = systemInfoRepository;
 }