示例#1
0
        public void find_by_method_if_it_exists()
        {
            var candidates = new ChainSearch
            {
                TypeMode = TypeSearchMode.Any,
                Type = typeof(SimpleInputModel),
                MethodName = "DoSomething"
            }.FindCandidatesByType(theGraph);

            candidates.First().Any().ShouldBeFalse();
            candidates.Last().Single().FirstCall().Description.ShouldEqual("SimpleInputModel.DoSomething(InputModel2 model) : void");
        }
示例#2
0
        public void find_by_method_if_it_exists_2()
        {
            var candidates = new ChainSearch
            {
                TypeMode = TypeSearchMode.Any,
                Type = typeof(SimpleInputModel),
                MethodName = "Query"
            }.FindCandidatesByType(theGraph);

            candidates.First().Select(x => x.FirstCall().Description)
                .ShouldHaveTheSameElementsAs("OneController.Query(SimpleInputModel model) : SimpleOutputModel");

            candidates.Last().Any().ShouldBeFalse();
        }
示例#3
0
        public void find_by_any_looks_at_input_model_first_then_handler_type_second()
        {
            var candidates = new ChainSearch{
                TypeMode = TypeSearchMode.Any,
                Type = typeof (SimpleInputModel)
            }.FindCandidatesByType(theGraph);

            candidates.Count().ShouldEqual(2);

            candidates.First().Select(x => x.FirstCall().Description)
                .ShouldHaveTheSameElementsAs("OneController.Query(SimpleInputModel model) : SimpleOutputModel", "TwoController.NotQuery(SimpleInputModel model) : SimpleOutputModel");

            candidates.Last().Single().FirstCall().Description.ShouldEqual("SimpleInputModel.DoSomething(InputModel2 model) : void");
        }