Exemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="pattern"></param>
        /// <param name="test"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public ICondition MockCond(Pattern pattern, IConditionTestValue test, IConditionFlagProcessor flags)
        {
            // create properties
            if (pattern == null)
            {
                pattern = new Pattern(".*", RegexOptions.Singleline);
            }

            if (test == null)
            {
                test = new Mock <IConditionTestValue>().Object;
            }

            if (flags == null)
            {
                flags = new Mock <IConditionFlagProcessor>().Object;
            }

            var condMock = new Mock <ICondition>();

            condMock.SetupGet(c => c.Pattern).Returns(pattern);
            condMock.SetupGet(c => c.Test).Returns(test);
            condMock.SetupGet(c => c.Flags).Returns(flags);
            var cond = condMock.Object;

            return(cond);
        }
Exemplo n.º 2
0
		/// <summary>
		/// 
		/// </summary>
		/// <param name="pattern"></param>
		/// <param name="test"></param>
		/// <param name="flags"></param>
		/// <returns></returns>
		public ICondition MockCond(Pattern pattern, IConditionTestValue test, IConditionFlagProcessor flags)
		{
			// create properties
			if (pattern == null)
				pattern = new Pattern(".*", RegexOptions.Singleline);

			if (test == null)
				test = new Mock<IConditionTestValue>().Object;

			if (flags == null)
				flags = new Mock<IConditionFlagProcessor>().Object;

			var condMock = new Mock<ICondition>();
			condMock.SetupGet(c => c.Pattern).Returns(pattern);
			condMock.SetupGet(c => c.Test).Returns(test);
			condMock.SetupGet(c => c.Flags).Returns(flags);
			var cond = condMock.Object;

			return cond;
		}
Exemplo n.º 3
0
 /// <summary>
 /// Inits the specified text.
 /// </summary>
 /// <param name="pattern">The pattern.</param>
 /// <param name="test">The test.</param>
 /// <param name="flags">The flags.</param>
 public void Init(Pattern pattern, IConditionTestValue test, IConditionFlagProcessor flags)
 {
     Pattern = pattern;
     Test    = test;
     Flags   = flags ?? new ConditionFlagProcessor();
 }
		/// <summary>
		/// Inits the specified text.
		/// </summary>
		/// <param name="pattern">The pattern.</param>
		/// <param name="test">The test.</param>
		/// <param name="flags">The flags.</param>
		public void Init(Pattern pattern, IConditionTestValue test, IConditionFlagProcessor flags)
		{
			Pattern = pattern;
			Test = test;
			Flags = flags ?? new ConditionFlagProcessor();
		}
 public AuthenticationTestValue(IConditionTestValue testValue)
 {
     Init(testValue.Test);
 }
 public void Init(Pattern pattern, IConditionTestValue test, IConditionFlagProcessor flags)
 {
     Pattern = pattern;
     Test = new AuthenticationTestValue(test);
     Flags = flags ?? new ConditionFlagProcessor();
 }
Exemplo n.º 7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DefaultCondition"/> class.
 /// </summary>
 /// <param name="pattern">The pattern.</param>
 /// <param name="test">The test.</param>
 /// <param name="flags">The flags.</param>
 public DefaultCondition(Pattern pattern, IConditionTestValue test, IConditionFlagProcessor flags)
 {
     ((ICondition)this).Init(pattern, test, flags);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="DefaultCondition"/> class.
 /// </summary>
 /// <param name="pattern">The pattern.</param>
 /// <param name="test">The test.</param>
 /// <param name="flags">The flags.</param>
 public DefaultCondition(Pattern pattern, IConditionTestValue test, IConditionFlagProcessor flags)
 {
     ((ICondition)this).Init(pattern, test, flags);
 }