コード例 #1
0
        public void DeleteButton_Test()
        {
            // Arrange
            DeviceModel deviceModel = new DeviceModel(_producerAccess)
            {
                Id            = 76,
                Name          = "Panel KTP900 Basic",
                ArticleNumber = "DSF98-DS9F8-DS98F",
                ProducerName  = "SIEMENS",
                Location      = "A2",
                Quantity      = 13,
                ProjectId     = 5
            };

            var deviceDetailsVM = new DeviceDetailsViewModel(_eventAggregator, _producerAccess, _deviceAccess);

            deviceDetailsVM.Device = deviceModel;
            deviceDetailsVM.LoadProducersRun();

            // Act
            deviceDetailsVM.DeleteButton();

            // Assert
            Assert.True(deviceDetailsVM.DeviceDeleteResult);
        }
コード例 #2
0
        public void CreateViewModel_Test()
        {
            // Arrange
            List <string> producersNameList = GenerateProducersNameList();

            // Act
            var deviceDetailsVM = new DeviceDetailsViewModel(_eventAggregator, _producerAccess, _deviceAccess);

            deviceDetailsVM.LoadProducersRun();

            // Assert
            Assert.IsType <BindableCollection <string> >(deviceDetailsVM.Producers);
            Assert.Equal(producersNameList.Count, deviceDetailsVM.Producers.Count);
            Assert.Equal(producersNameList[0], deviceDetailsVM.Producers[0]);
            Assert.Equal(producersNameList[3], deviceDetailsVM.Producers[3]);
        }