예제 #1
0
        public void PropertyNullOrEmpty_Success()
        {
            //Arrange
            var validator = new PropertyNullOrEmpty(new KeyValuePair <string, string>("PropertyKey", "PropertyValue"));
            //Act
            var result = validator.Process();

            //Assert
            Assert.AreEqual(result.StatusCode, StatusCode.Success);
            Assert.IsTrue(string.IsNullOrEmpty(result.StatusDetail));
        }
예제 #2
0
        public void PropertyNullOrEmpty_Failed()
        {
            //Arrange
            var validator = new PropertyNullOrEmpty(new KeyValuePair <string, string>("PropertyKey", null));
            //Act
            var result = validator.Process();

            //Assert
            Assert.AreEqual(result.StatusCode, StatusCode.Failed);
            Assert.AreEqual(result.ErrorCode, ErrorCode.ValueIsNullOrEmpty);
            Assert.IsTrue(!string.IsNullOrEmpty(result.StatusDetail));
        }