Exemplo n.º 1
0
        public void TestIsValidSinglePropertySucceeds()
        {
            var sut = new BaseDtoImplementation1
            {
                RequiredStringProperty1 = "arbitrary-value"
            };

            var isValidProperty1 = sut.IsValid("RequiredStringProperty1");

            Assert.IsTrue(isValidProperty1);

            var isValidProperty2 = sut.IsValid("RequiredStringProperty2");

            Assert.IsFalse(isValidProperty2);

            var isValidClass = sut.IsValid();

            Assert.IsFalse(isValidClass);
        }
Exemplo n.º 2
0
        public void TestIsValidSinglePropertyAndValueSucceeds()
        {
            var sut = new BaseDtoImplementation1
            {
                RequiredStringProperty1 = "arbitrary-value"
            };

            var isValidProperty2 = sut.IsValid("RequiredStringProperty2", null);

            Assert.IsFalse(isValidProperty2);
        }