Ejemplo n.º 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));
        }
Ejemplo n.º 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));
        }