// TODO: This can be intialized using TestFixture
        public ProfanityCheckServiceTests()
        {
            this.serviceUnderTests = new ProfanityCheckService();

            this.serviceUnderTests.AddBannedWordsFromTextFile("Test.txt");
            this.serviceUnderTests.AddNewBannedWordsFromGitHub("https://raw.githubusercontent.com/chucknorris-io/swear-words/master/fi");
            this.serviceUnderTests.AddNewBannedWordsFromGitHub("https://raw.githubusercontent.com/chucknorris-io/swear-words/master/en");
        }
Exemple #2
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            // Allow Content-Negotiation
            services.AddControllers(opts =>
            {
                opts.RespectBrowserAcceptHeader = true;
            });

            services.AddSingleton <ICheckProfanity, ProfanityCheckService>((svc) =>
            {
                var newSvc = new ProfanityCheckService();

                newSvc.AddNewBannedWordsFromGitHub("https://raw.githubusercontent.com/chucknorris-io/swear-words/master/fi");
                newSvc.AddNewBannedWordsFromGitHub("https://raw.githubusercontent.com/chucknorris-io/swear-words/master/en");
                newSvc.AddBannedWordsFromTextFile("Banned_Words.txt");

                return(newSvc);
            });
        }