Beispiel #1
0
        public void Parse_ReturnsExpectedForKnownValues(string value)
        {
            var defaultValue = (DirectSubmissionLogLevel)123;
            var parsed       = DirectSubmissionLogLevelExtensions.Parse(value, defaultValue);

            parsed.Should().Be(DirectSubmissionLogLevel.Verbose);
        }
Beispiel #2
0
        public void Parse_ReturnsDefaultForUnknownValues(string value)
        {
            var defaultValue = (DirectSubmissionLogLevel)123;
            var parsed       = DirectSubmissionLogLevelExtensions.Parse(value, defaultValue);

            parsed.Should().Be(defaultValue);
        }
Beispiel #3
0
        public void Parse_IsValidForAllValidValues()
        {
            var allValues = Enum.GetValues(typeof(DirectSubmissionLogLevel))
                            .Cast <DirectSubmissionLogLevel>();

            foreach (var value in allValues)
            {
                var parsed = DirectSubmissionLogLevelExtensions.Parse(value.ToString(), defaultLevel: (DirectSubmissionLogLevel)123);
                parsed.Should().Be(value);
            }
        }