Ejemplo n.º 1
0
        public void ClearButton_Test()
        {
            // Arrange
            string validDeviceName           = "Panel KTP900 Basic";
            string validArticleNumber        = "DSF98-DS9F8-DS98F";
            string validSelectedProducerName = "SIEMENS";
            string validLocation             = "A2";
            int    validQuantity             = 13;

            var newDeviceVM = new ProjectNewDeviceViewModel(_events, _deviceAccess, _producerAccess);

            newDeviceVM.DeviceName       = validDeviceName;
            newDeviceVM.ArticleNumber    = validArticleNumber;
            newDeviceVM.SelectedProducer = validSelectedProducerName;
            newDeviceVM.Location         = validLocation;
            newDeviceVM.Quantity         = validQuantity;

            // Act
            newDeviceVM.ClearButton();

            // Assert
            Assert.Equal("", newDeviceVM.DeviceName);
            Assert.Equal("", newDeviceVM.ArticleNumber);
            Assert.Equal("", newDeviceVM.Location);
            Assert.Equal(0, newDeviceVM.Quantity);
        }
Ejemplo n.º 2
0
        public void SaveButton_InvalidData_Test(string deviceName, string articleNumber,
                                                string producerName, string location, int quantity)
        {
            // Arrange
            var newDeviceVM = new ProjectNewDeviceViewModel(_events, _deviceAccess, _producerAccess);

            newDeviceVM.DeviceName       = deviceName;
            newDeviceVM.ArticleNumber    = articleNumber;
            newDeviceVM.SelectedProducer = producerName;
            newDeviceVM.Location         = location;
            newDeviceVM.Quantity         = quantity;

            // Act
            newDeviceVM.SaveButton();

            // Assert
            Assert.False(newDeviceVM.DeviceValidationResult);
            Assert.False(newDeviceVM.DeviceAddResult);
        }