public static void GetAllEnumValues()
    {
        var enumFields   = typeof(SampleEnum).GetFields();
        var actualValues = new SampleEnum[enumFields.Length - 1];

        for (var i = 1; i < enumFields.Length; ++i)
        {
            actualValues[i - 1] = (SampleEnum)enumFields[i].GetValue(null) !;
        }

        var expectedValues = (SampleEnum[])Enum.GetValues(typeof(SampleEnum));

        actualValues.Should().Equal(expectedValues);
    }
Example #2
0
 public void InlineAutoNSubstituteData_Should_Call_For_Each_Value(
     SampleEnum value,
     [Frozen] ISampleInterface interfaceType,
     SampleClass concreteType,
     SampleDependantClass dependantType)
 {
     value.Should().BeOneOf(SampleEnum.One, SampleEnum.Two, SampleEnum.Three);
     interfaceType.Should().NotBeNull();
     interfaceType.IsSubstitute().Should().BeTrue();
     concreteType.Should().NotBeNull();
     concreteType.IsSubstitute().Should().BeFalse();
     dependantType.Should().NotBeNull();
     dependantType.Dependency.Should().Be(interfaceType);
 }