コード例 #1
0
        public void ShouldReturnNullWhenEmptyArgumentListIsGiven()
        {
            // arrange
            string[] arguments = new string[1];

            // act
            string result = ArgumentParsingHelper.GetArgumentValueFromArguments(arguments, "parameter:");

            // assert
            Assert.That(result, Is.Null);
        }
コード例 #2
0
        public void ShouldThrowNullReferenceExceptionWhenGivenKeyIsNotFound()
        {
            // arrange
            string[] arguments = new string[1];
            arguments[0] = "notgiven: valueToReturn";

            // act
            string result = ArgumentParsingHelper.GetArgumentValueFromArguments(arguments, "parameter:");

            // assert
            Assert.That(result, Is.Null);
        }
コード例 #3
0
        public void ShouldReturnValueAfterGivenOptionFromStringArrayWithOneItem()
        {
            // arrange
            string[] arguments = new string[1];
            arguments[0] = "parameter: valueToReturn";

            // act
            string result = ArgumentParsingHelper.GetArgumentValueFromArguments(arguments, "parameter:");

            // assert
            Assert.That(result, Is.EqualTo(" valueToReturn"));
        }