Exemple #1
0
            public void Validate_ValidCommand_Returns(UpdateEndpoint command, UpdateEndpointValidator subject)
            {
                // Arrange

                // Act
                var result = subject.TestValidate(command);

                // Assert
                result.ShouldNotHaveAnyValidationErrors();
            }
Exemple #2
0
            public void Validate_EmptySerialNumber_Throws(UpdateEndpointValidator subject)
            {
                // Arrange

                // Act
                var result = subject.TestValidate(new UpdateEndpoint {
                    SwitchState = (SwitchStates)1, SerialNumber = string.Empty
                });

                // Assert
                result.ShouldHaveValidationErrorFor(c => c.SerialNumber);
            }
Exemple #3
0
            public void Validate_InvalidSwitchStates_Throws(string serial, int state)
            {
                // Arrange
                var subject = new UpdateEndpointValidator();

                // Act
                var result = subject.TestValidate(new UpdateEndpoint {
                    SwitchState = (SwitchStates)state, SerialNumber = serial
                });

                // Assert
                result.ShouldHaveValidationErrorFor(c => c.SwitchState);
            }