Exemplo n.º 1
0
        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();
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
 public UserInteractions(IGuestBookAccess guestBookAccess)
 {
     this.guestBookAccess = guestBookAccess;
 }
Exemplo n.º 4
0
 public UserInteractions(IPortfolioAccess portfolioAccess, IGuestBookAccess guestBookAccess)
 {
     this.portfolioAccess = portfolioAccess;
     this.guestBookAccess = guestBookAccess;
 }