コード例 #1
0
        public void EvaluateIgnoresDuplicatedMethods()
        {
            MethodInfo method1 = typeof(SampleWebTestClass).GetMethod("SampleWebTestMethod1");
            MethodInfo method2 = typeof(SampleWebTestClass).GetMethod("SampleWebTestMethod1");

            Dictionary <string, List <MethodInfo> > tags = new Dictionary <string, List <MethodInfo> >();

            tags.Add("foo", new List <MethodInfo>()
            {
                method1
            });
            tags.Add("bar", new List <MethodInfo>()
            {
                method2
            });

            WebTestTagExpressionEvaluator evaluator = new WebTestTagExpressionEvaluator();
            List <MethodInfo>             filtered  = evaluator.Evaluate(
                "foo@bar",
                BrowserVersions.All,
                new List <MethodInfo>(),
                new Dictionary <MethodInfo, BrowserVersions>(),
                tags);

            UnitTestAssert.AreEqual(1, filtered.Count);
        }
コード例 #2
0
        public void EvaluateThrowsExceptionIfTestWithSuppliedTagIsNotFound()
        {
            WebTestTagExpressionEvaluator evaluator = new WebTestTagExpressionEvaluator();

            evaluator.Evaluate(
                "foo",
                BrowserVersions.All,
                new List <MethodInfo>(),
                new Dictionary <System.Reflection.MethodInfo, BrowserVersions>(),
                new Dictionary <string, List <System.Reflection.MethodInfo> >());
        }
コード例 #3
0
        public void EvaluateReturnsListWithASingleTestThatMatchesTheTag()
        {
            MethodInfo method = typeof(SampleWebTestClass).GetMethod("SampleWebTestMethod1");

            Dictionary <string, List <MethodInfo> > tags = new Dictionary <string, List <MethodInfo> >();

            tags.Add("foo", new List <MethodInfo>()
            {
                method
            });

            WebTestTagExpressionEvaluator evaluator = new WebTestTagExpressionEvaluator();
            List <MethodInfo>             filtered  = evaluator.Evaluate(
                "foo",
                BrowserVersions.All,
                new List <MethodInfo>(),
                new Dictionary <MethodInfo, BrowserVersions>(),
                tags);

            UnitTestAssert.AreEqual(1, filtered.Count);
            UnitTestAssert.AreSame(method, filtered[0]);
        }