Пример #1
0
        public void MustHaveCorrespondingEnumConventionSpecification_FailsWhenExtraValue()
        {
            var result = new MustHaveCorrespondingEnumConventionSpecification(typeof(SourceEnum))
                         .IsSatisfiedBy(typeof(ExtraValue.SourceEnum));

            result.IsSatisfied.Should().BeFalse();
            result.Failures.Should().Contain("Value3 (3) does not match any values");
        }
Пример #2
0
        public void MustHaveCorrespondingEnumConventionSpecification_FailsWhenNoMatchingName()
        {
            var result = new MustHaveCorrespondingEnumConventionSpecification(typeof(SourceEnum))
                         .IsSatisfiedBy(typeof(DifferentNamedEnum));

            result.IsSatisfied.Should().BeFalse();
            result.Failures.Should().Contain("does not match any of the supplied type names");
        }
Пример #3
0
        public void MustHaveCorrespondingEnumConventionSpecification_FailsWhenDifferentName()
        {
            var result = new MustHaveCorrespondingEnumConventionSpecification(typeof(SourceEnum))
                         .IsSatisfiedBy(typeof(DifferentName.SourceEnum));

            result.IsSatisfied.Should().BeFalse();
            result.Failures.Should().Contain("Value2 (2) does not match names with the corresponding value");
            result.Failures.Should().Contain("Value3 (2) does not match names with the corresponding value");
        }