public void Should_Be_Case_Insensitive(string key, string expected)
            {
                // Given
                var options = new CakeOptions();

                options.Arguments.Add("A", "B");
                var arguments = new CakeArguments(options);

                // When
                var result = arguments.GetArgument(key);

                // Then
                Assert.Equal(expected, result);
            }
Beispiel #2
0
        public void Should_Return_The_Last_Argument_If_Multiple_Ones_With_The_Same_Name_Exist()
        {
            // Given
            var arguments = new CakeArguments(new List <Tuple <string, string> >
            {
                Tuple.Create("FOO", "BAR"),
                Tuple.Create("FOO", "BAZ"),
            }.ToLookup(x => x.Item1, x => x.Item2));

            // When
            var result = arguments.GetArgument("FOO");

            // Then
            Assert.Equal("BAZ", result);
        }
Beispiel #3
0
            public void Should_Return_Argument_Exist(string key, string expected)
            {
                // Given
                var arguments = new CakeArguments();

                arguments.SetArguments(new Dictionary <string, string> {
                    { "A", "B" }
                });

                // When
                var result = arguments.GetArgument(key);

                // Then
                Assert.Equal(expected, result);
            }
Beispiel #4
0
        public void Should_Return_Null_If_Argument_Is_Missing()
        {
            // Given
            var arguments = new CakeArguments(new List <Tuple <string, string> >
            {
                Tuple.Create("FOO", "BAR"),
                Tuple.Create("BAZ", "CORGI"),
            }.ToLookup(x => x.Item1, x => x.Item2));

            // When
            var result = arguments.GetArgument("WALDO");

            // Then
            Assert.Null(result);
        }