public void WriteInGuestBookNoNicknameTest()//if the user leaves the nickname field empty after clearing it { GuestBookAccess = new TGuestBookAccess(); Interactions = new UserInteractions(GuestBookAccess); GuestBookDTO GuestBook = new GuestBookDTO(1, DateTime.MinValue, "TestMessage", null); Interactions.WriteInGuestBook(GuestBook); GuestBookDTO latest = GuestBookAccess.GetLatestEntry(); Assert.Fail(); }
public void WriteInGuestBookSuccessTest() { GuestBookAccess = new TGuestBookAccess(); Interactions = new UserInteractions(GuestBookAccess); GuestBookDTO GuestBook = new GuestBookDTO(1, DateTime.MinValue, "TestMessage", "Jim"); Interactions.WriteInGuestBook(GuestBook); GuestBookDTO latest = GuestBookAccess.GetLatestEntry(); Assert.AreEqual(GuestBook.PostDate, latest.PostDate); Assert.AreEqual(GuestBook.Message, latest.Message); Assert.AreEqual(GuestBook.NickName, latest.NickName); }
public UserInteractions(IGuestBookAccess guestBookAccess) { this.guestBookAccess = guestBookAccess; }
public UserInteractions(IPortfolioAccess portfolioAccess, IGuestBookAccess guestBookAccess) { this.portfolioAccess = portfolioAccess; this.guestBookAccess = guestBookAccess; }