public void TestGetContentForUser()
        {
            string con = "This is bad content.";

            _contentRep.Setup(x => x.Content).Returns(con);
            _svc = new UserContentService(_contentRep.Object, _negContentRep.Object);
            Assert.AreEqual(_svc.GetContent(), con);
        }
        public void TestNegContentCountForUser()
        {
            string con = "This is bad content.";

            _contentRep.Setup(x => x.Content).Returns(con);
            _negContentRep.Setup(x => x.Content).Returns("bad swine");
            _svc = new UserContentService(_contentRep.Object, _negContentRep.Object);
            Assert.AreEqual(_svc.CountNegativeWords(), 1);
        }
Example #3
0
 internal UserContentInstance(DatabaseContext databaseContext,
                              string tableName,
                              ICacheRefresher refresher,
                              IRuntimeCacheProvider cacheProvider)
 {
     Repository = new UserContentRepository <TUserContent, TUserContentDTO>(databaseContext, tableName);
     Service    = new UserContentService <TUserContent, TUserContentDTO>(
         (UserContentRepository <TUserContent, TUserContentDTO>)Repository, refresher);
     Cache = cacheProvider;
 }
 public void ClearData()
 {
     _contentRep    = null;
     _negContentRep = null;
     _svc           = null;
 }