コード例 #1
0
            public void GivenErrorMessageIsntAlreadySet_ReturnsInterchangeExceptionMessage()
            {
                // Arrange
                var attribute = new DiagnoseaEmailAddressAttribute();

                // Act
                var result = attribute.FormatErrorMessage("name");

                // Assert
                Assert.That(result, Is.EqualTo(ExceptionMessages.Interchange.InvalidEmailAddress));
            }
コード例 #2
0
            public void GivenErrorMessageIsAlreadySet_ReturnsAlreadySetErrorMessage()
            {
                // Arrange
                var attribute = new DiagnoseaEmailAddressAttribute {
                    ErrorMessage = "This is an error message"
                };

                // Act
                var result = attribute.FormatErrorMessage("name");

                // Assert
                Assert.That(result, Is.EqualTo(attribute.ErrorMessage));
            }