Beispiel #1
0
        public void ValidatingPropertyFromEnumFails()
        {
            // Arrange
            var sut = new ClassWithValidateSetEnum
            {
                Property = "invalid-enum-value"
            };

            // Act
            var result = sut.IsValid();

            // Assert
            Assert.IsFalse(result);
        }
Beispiel #2
0
        public void ValidatingPropertyFromEnumSucceeds()
        {
            // Arrange
            var sut = new ClassWithValidateSetEnum
            {
                Property = EnumsToBeValidated.Value2.ToString()
            };

            // Act
            var result = sut.IsValid();

            // Assert
            Assert.IsTrue(result);
        }