Exemple #1
0
        public void FormatValidation__Email()
        {
            //Arrange
            var request  = new Mock <HttpRequestBase>();
            var value    = "kidd#gameball.com.tw";
            var field    = "電子信箱";
            var expected = "電子信箱格式不正確";

            //Act
            RequestWrapper wrapper = new RequestWrapper(request.Object);

            wrapper.CustomValidate(new EmailFormatValidation(), value, true, field);
            var result = wrapper.GetErrorMessage(ErrorOuputType.Text);

            //Assert
            Trace.WriteLine(result);
            Assert.AreEqual(expected, result);
        }