示例#1
0
        public void PostCommentSuccessTest()
        {
            PortfolioAccess = new TPortfolioAccess();
            Interactions    = new UserInteractions(PortfolioAccess);
            AccountDTO   account   = new AccountDTO(0, "*****@*****.**", "Jim", "Test123");
            PortfolioDTO portfolio = new PortfolioDTO(0, "Test", new List <string>(), "This is pretty short for a portfolio.", new DateTime(2020, 01, 01), new List <string>());
            string       comment   = "This is a test comment.";

            Interactions.PostComment(account, portfolio, comment);

            Assert.AreEqual(PortfolioAccess.Read(0).Comments[0], ("Jim posted: " + comment));
        }
示例#2
0
        public void EditPortfolioSuccessTest()
        {
            Admin = new AdminInteractions(portfolioAccess);
            PortfolioDTO Changes  = new PortfolioDTO(0, "TestTitle", null, "Lorem Ipsum", DateTime.MinValue, null);
            PortfolioDTO Expected = new PortfolioDTO(0, "TestTitle", new List <string>(), "Lorem Ipsum", new DateTime(2020, 01, 01), new List <string>(), DateTime.Today);

            Expected.Comments.Add("Jimmy John Jr");
            Expected.PageCategory.Add("Test");
            Admin.EditPortfolio(Changes.Id, Changes);
            PortfolioDTO Result = portfolioAccess.Read(0);

            Assert.AreEqual(Expected.Id, Result.Id);
            Assert.AreEqual(Expected.Title, Result.Title);
            Assert.AreEqual(Expected.PageCategory.Count, Result.PageCategory.Count); //idk
            Assert.AreEqual(Expected.Content, Result.Content);
            Assert.AreEqual(Expected.CreationDate, Result.CreationDate);             //wrong variable
            Assert.AreEqual(Expected.Comments.Count, Result.Comments.Count);         //idk
            Assert.AreEqual(Expected.EditDate, Result.EditDate);
        }
示例#3
0
 public PortfolioDTO GetPortfolio(int index)
 {
     return(portfolioAccess.Read(index));
 }