Antmicro.OptionsParser.Tests.ValidationTests.ShouldThrowAnExceptionWhenDefaultValueIsOfAWrongType C# (CSharp) Метод

ShouldThrowAnExceptionWhenDefaultValueIsOfAWrongType() приватный Метод

private ShouldThrowAnExceptionWhenDefaultValueIsOfAWrongType ( ) : void
Результат void
        public void ShouldThrowAnExceptionWhenDefaultValueIsOfAWrongType()
        {
            var args = new [] { "--arg" };

            var parser = new OptionsParser();
            var options = new OptionsWithDefault();

            try
            {
                parser.Parse(options, args);
                Assert.Fail("Expected exception");
            }
            catch(ArgumentException e)
            {
                Assert.IsTrue(e.Message.Contains("is of unexpected type"));
            }
        }