Exemple #1
0
        public void Execute_DuplicateParameterNames()
        {
            var printer = new Printer();
            var sample = new Sample_05 { Printer = printer };

            Expect(() => Parser.Run(new[]
                                        {
                                            "p",
                                        }, sample),
                    Throws.InstanceOf<InvalidOperationException>()
                    .With.Message.ContainsSubstring("Duplicate parameter names found in Print: c, x"));
        }
Exemple #2
0
        public void Execute_DuplicateParameterNames()
        {
            try
            {
                var printer = new Printer();
                var sample = new Sample_05 { Printer = printer };

                Parser.Run(new[]
                {
                    "p",
                }, sample);

                Assert.Fail();
            }
            catch (InvalidOperationException ex)
            {
                Assert.IsTrue(ex.Message.Contains("Duplicate parameter names found in Print: c, x"));
            }
        }