public void SaveTest2() { manager.Save(article); ArrayList articles = articleRepo.GetAll(); Article article2 = (Article)articles[0]; Assert.AreEqual(Constants.StringTest, article2.Title); Assert.AreEqual(Constants.StringTest, article2.Content); }
public void RepoTest() { Assert.AreEqual(1, 1); _userRepository.SetValidator(userValidator); _articleRepository.SetValidator(articleValidator); _authorRepository.SetValidator(authorValidator); _userRepository.Save(user); _authorRepository.Save(author); _articleRepository.Save(article); ArrayList users = _userRepository.GetAll(); ArrayList authors = _authorRepository.GetAll(); ArrayList articles = _articleRepository.GetAll(); Assert.IsNotNull(users[0]); User userResult = (User)users[0]; Author authorResult = (Author)authors[0]; Article articleResult = (Article)articles[0]; _userRepository.SetXMLFilename("test.xml"); _userRepository.SaveAllToXML(); UserRepo second = new UserRepo(); second.SetXMLFilename("test.xml"); second.LoadAllFromXML(); second.SetXMLFilename("w"); // Assert.AreEqual(Constants.StringTest, userResult.Username); // Assert.AreEqual(Constants.StringTest, authorResult.Name); // Assert.AreEqual(Constants.StringTest, articleResult.Title); }
public ArrayList GetAllNews() { return(_articleGenericRepository.GetAll()); }