示例#1
0
        public void InitializeFromFullCmdLine_AssignmentDelimiterColonOneArgument_InitializedFromArgs()
        {
            // Arrange
            var cmdLineObj = new ColonAssignmentDelimiterCmdLineObject();

            // Act
            cmdLineObj.InitializeFromCmdLine(new[] { "/Name:John" });

            //Assert
            Assert.That(cmdLineObj.Name, Is.EqualTo("John"));
        }
示例#2
0
        InitializeFromFullCmdLine_AssignmentDelimiterColonArrayArgumentsValueContainsDoubleQuotes_InitializedFromArgs
            ()
        {
            // Arrange
            var cmdLineObj = new ColonAssignmentDelimiterCmdLineObject();

            // Act
            cmdLineObj.InitializeFromCmdLine(new[] { @"/Name:""John Smith""" });

            //Assert
            Assert.That(cmdLineObj.Name, Is.EqualTo("John Smith"));
        }
示例#3
0
        public void GetHelpText_ColonAssignmentDelimiterCmdLineObject_UsageContainsSpace()
        {
            // Arrange
            var cmdLineObj = new ColonAssignmentDelimiterCmdLineObject();

            // Act
            cmdLineObj.InitializeFromCmdLine(new[] { "/Name", "John" });

            //Assert
            string helpText = cmdLineObj.GetHelpText(80);

            Assert.That(helpText, Is.EqualTo(@"Command-line options.

 [/Name:<Name>] [/?[-]]

/Name      The name of the user
/Count     Count
           Default Value: 0
/?         Displays command-line usage information.
           Default Value: False
"));
        }