示例#1
0
        /// <summary>
        /// The check usage instructions.
        /// </summary>
        /// <param name="arguments">
        /// The args.
        /// </param>
        private void FromArgs(IList <string> arguments)
        {
            var argumentRules = new ArgumentRules(this, this.compilationLevelHelper);

            this.AreValid = argumentRules.AnySatisfiedBy(arguments);

            if (!this.AreValid)
            {
                EmitUsageInstructions();
            }
        }
        public void Single_FileName_Argument_Is_Valid()
        {
            // Arrange
            var commandLineArgumentsMock = Mock.Of<ICommandLineArguments>();
            var compilationLevelHelperMock = new Mock<ICompilationLevelHelper>();
            compilationLevelHelperMock.Setup(m => m.From(It.IsAny<string>())).Returns("ADVANCED_OPTIMIZATIONS");

            var argumentRules = new ArgumentRules(commandLineArgumentsMock, compilationLevelHelperMock.Object);

            var arguments = new List<string> { "sample.js" };

            // Act
            var anyRulesSatified = argumentRules.AnySatisfiedBy(arguments);

            // Assert
            Assert.True(anyRulesSatified);
        }
        public void FileName_And_WarningSuppression_Argument_Is_Valid()
        {
            // Arrange
            var commandLineArgumentsMock = Mock.Of<ICommandLineArguments>();
            var compilationLevelHelperMock = new Mock<ICompilationLevelHelper>();
            compilationLevelHelperMock.Setup(m => m.From(It.IsAny<string>())).Returns("ADVANCED_OPTIMIZATIONS");

            var argumentRules = new ArgumentRules(commandLineArgumentsMock, compilationLevelHelperMock.Object);

            var arguments = new List<string> { "sample.js", "/sJSC_BAD_TYPE_FOR_BIT_OPERATION" };

            // Act
            var anyRuleComboSatified = argumentRules.AnySatisfiedBy(arguments);

            // Assert
            Assert.True(true);
        }
        /// <summary>
        /// The check usage instructions.
        /// </summary>
        /// <param name="arguments">
        /// The args.
        /// </param>
        private void FromArgs(IList<string> arguments)
        {
            var argumentRules = new ArgumentRules(this, this.compilationLevelHelper);
            this.AreValid = argumentRules.AnySatisfiedBy(arguments);

            if (!this.AreValid)
            {
                EmitUsageInstructions();
            }
        }