public void WithRandomController_ShouldSubscribeForChangesOnRandomController()
        {
            string randomModuleName       = CreateRandom.String();
            int    randomControllerId     = CreateRandom.Int();
            GenericPlcViewModel viewModel = CreateGenericPlcViewModel(moduleName: randomModuleName);

            viewModel.SelectedItem = MasterDetailViewModel(randomModuleName, randomControllerId);
            _informationProvider.Verify(x => x.SubscribeForControllerChanges(randomModuleName, randomControllerId, It.IsAny <Action <Controller> >()));
        }
        public void WithRandomController_ShouldImportSelectedController()
        {
            string randomModuleName       = CreateRandom.String();
            int    randomControllerId     = CreateRandom.Int();
            GenericPlcViewModel viewModel = CreateGenericPlcViewModel(moduleName: randomModuleName);

            viewModel.SelectedItem = MasterDetailViewModel(randomModuleName, randomControllerId);
            _informationProvider.Verify(x => x.ImportController(randomModuleName, randomControllerId));
        }
        public void ShouldUnsubscribeFromSelectedItem()
        {
            int randomController = CreateRandom.Int();
            TestableGenericPlcViewModel viewModel = CreateTestableGenericPlcViewModel(moduleName: _randomModule);

            viewModel.SelectedItem = MasterDetailViewModel(_randomModule, randomController);
            viewModel.Deactivate();
            _informationProvider.Verify(i => i.UnsubscribeFromControllerChanges(_randomModule, randomController, It.IsAny <Action <Controller> >()));
        }
        public void Setup()
        {
            _randomModule     = CreateRandom.String();
            _randomController = CreateRandom.Int();
            _innerController  = new Controller();

            _commander = new Mock <ICommandControllers>();
            _states    = new Mock <IProvideStatesForScreenActivation>();

            SetupConcrete();
        }
Esempio n. 5
0
        public void OnPreviouslyDeactivatedViewModel_ShouldSubscribeForSelectedItem()
        {
            int randomController = CreateRandom.Int();
            TestableGenericPlcViewModel viewModel     = CreateTestableGenericPlcViewModel(moduleName: _randomModule);
            MasterDetailViewModel       anyController = MasterDetailViewModel(_randomModule, randomController);

            viewModel.MasterTree.Add(anyController);
            viewModel.SelectedItem = anyController;
            viewModel.Deactivate();
            viewModel.Activate();
            _informationProvider.Verify(x => x.SubscribeForControllerChanges(_randomModule, randomController, It.IsAny <Action <Controller> >()));
        }
Esempio n. 6
0
 private User CreateRandomOperatorUser()
 {
     return(new User
     {
         AuthType = AuthTypes.Operator,
         Description = CreateRandom.String(),
         Id = 3,
         LoggedIn = false,
         LoginFailedCount = CreateRandom.Int(),
         Name = "Operator",
         Password = "******"
     });
 }
Esempio n. 7
0
 private User CreateRandomEngineerUser()
 {
     return(new User
     {
         AuthType = AuthTypes.Engineer,
         Description = CreateRandom.String(),
         Id = 2,
         LoggedIn = false,
         LoginFailedCount = CreateRandom.Int(),
         Name = "Engineer",
         Password = "******"
     });
 }
Esempio n. 8
0
 private User CreateRandomAdministratorUser()
 {
     return(new User
     {
         AuthType = AuthTypes.Administrator,
         Description = CreateRandom.String(),
         Id = 1,
         LoggedIn = true,
         LoginFailedCount = CreateRandom.Int(),
         Name = "Admin",
         Password = "******"
     });
 }
Esempio n. 9
0
        public void Setup()
        {
            _loa1Port = CreateRandom.Int();

            _loa1Module = new VirtualPlatformModule {
                Name = Loa1(), AdsPort = _loa1Port, StreamType = 1
            };
            _lab1Module = new VirtualPlatformModule {
                Name = Lab1(), AdsPort = 113, StreamType = 1
            };
            _ovenModule = new VirtualPlatformModule {
                Name = SingleOvenModule, AdsPort = 841, StreamType = 2
            };
        }
Esempio n. 10
0
 protected static Alarm CreateRandomAlarm()
 {
     return(new Alarm {
         AlarmId = CreateRandom.Int(), Source = CreateRandom.String()
     });
 }
Esempio n. 11
0
        public void CreateRandom_Int_should_work()
        {
            int randomValue = CreateRandom.Int();

            Assert.IsNotNull(randomValue);
        }