public void PostCommentNoNicknameTest() { PortfolioAccess = new TPortfolioAccess(); Interactions = new UserInteractions(PortfolioAccess); AccountDTO account = new AccountDTO(0, "*****@*****.**", null, "Test123"); PortfolioDTO portfolio = new PortfolioDTO(0, "Test", new List <string>(), "This is pretty short for a portfolio.", DateTime.MinValue, new List <string>()); string comment = "This is a test comment."; Interactions.PostComment(account, portfolio, comment); Assert.Fail(); }
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)); }