Ejemplo n.º 1
0
        public void Test_CheckWebsite_BlockWebsite()
        {
            //Arrange
            var url = "https://google.com";

            var websiteBlockerFacade = MockWebsiteBlockerFacade(url, true);
            var appSettings          = new WebsiteBlockerAppSettings()
            {
                BlacklistedSites = new List <string>(), BlacklistedWords = new List <string>(), WhitelistedSites = new List <string>()
            };
            var controller = CreateHomeController(websiteBlockerFacade, appSettings);

            //Act
            var result = controller.CheckWebsite(url);

            //Assert
            AssertOkResult(true, result);
        }
Ejemplo n.º 2
0
        private HomeController CreateHomeController(IWebsiteBlockerFacade websiteBlockerFacade = null, WebsiteBlockerAppSettings appSettings = null)
        {
            var options = Options.Create(appSettings);

            return(new HomeController(websiteBlockerFacade, options));
        }