예제 #1
0
        public void Valid_EntityIsInvalid_Ok()
        {
            var target = new EntityValidator <Entity>(new Entity
            {
                RequiredTitle    = "Awesome title 1234567890",
                NonRequiredTitle = "Awesome nit-required title 1234567890",
                Year             = 3020
            });

            Assert.False(target.Valid());
        }
예제 #2
0
        public void Valid_EntityIsValid_Ok()
        {
            var target = new EntityValidator <Entity>(new Entity
            {
                RequiredTitle    = "Awesome",
                NonRequiredTitle = null,
                Year             = 2020
            });

            Assert.True(target.Valid());

            target.ThrowIfInvalid();
        }