main
 1using developwithpassion.bdd.contexts;
 2using developwithpassion.bdd.harnesses.mbunit;
 3using gorilla.migrations;
 4
 5namespace tests.core
 6{
 7    public class ConsoleArgumentsSpecs
 8    {
 9        public class concern : observations_for_a_sut_without_a_contract<ConsoleArguments>
10        {
11            after_the_sut_has_been_created a = () =>
12            {
13                args = controller.sut;
14            };
15
16            static protected ConsoleArguments args;
17        }
18
19        public class When_parsing_the_value_for_a_console_argument : concern
20        {
21            context c = () =>
22            {
23                arguments = new[] {"-first_param:'c:\\tmp' -second_param:'Server=(local)'"};
24            };
25
26            after_the_sut_has_been_created a = () =>
27            {
28                args.arguments = arguments;
29            };
30
31            because b = () =>
32            {
33                result = args.parse_for("second_param");
34            };
35
36            it should_return_the_value_specified = () =>
37            {
38                result.should_be_equal_to("Server=(local)");
39            };
40
41            static string result;
42            static string[] arguments;
43        }
44    }
45}