Exemple #1
0
        public void TagController_Search_ShouldCallTagServiceSearch()
        {
            var tagService = A.Fake<ITagAdminService>();
            var tagController = new TagController(tagService);

            tagController.Search( "test");

            A.CallTo(() => tagService.Search("test")).MustHaveHappened();
        }
Exemple #2
0
        public void TagController_Search_ShouldReturnTheResultOfTheServiceQuery()
        {
            var tagService = A.Fake<ITagAdminService>();
            var tagController = new TagController(tagService);
            IEnumerable<AutoCompleteResult> results = Enumerable.Empty<AutoCompleteResult>();
            A.CallTo(() => tagService.Search("test")).Returns(results);

            JsonResult result = tagController.Search("test");
            result.Data.As<IEnumerable<AutoCompleteResult>>().Should().BeEquivalentTo(results);
        }