Example #1
0
        public void GetsAllMembers()
        {
            //Arrange
            FakeMemberRepository repository = new FakeMemberRepository();
            HomeController       controller = new HomeController(repository);

            //Act
            List <Member> members = controller.Members().ViewData.Model as List <Member>;

            //Assert
            Assert.Equal(repository.GetAllMembers()[0].FirstName, members[0].FirstName);
            Assert.Equal(repository.GetAllMembers()[0].LastName, members[0].LastName);
            Assert.Equal(repository.GetAllMembers()[1].FirstName, members[1].FirstName);
            Assert.Equal(repository.GetAllMembers()[1].LastName, members[1].LastName);
        }
Example #2
0
        public void GetMessagesByMember()
        {
            //Arrange
            FakeMessageRepository messageRepo = new FakeMessageRepository();
            //ForumController controller = new ForumController(messageRepo);


            FakeMemberRepository memberRepo  = new FakeMemberRepository();
            HomeController       controller2 = new HomeController(memberRepo);


            //Act
            List <Member> members = controller2.Members().ViewData.Model as List <Member>;
            Member        user    = members[0];

            // List<Message> messages = controller.MyMessages(user).ViewData.Model as List<Message>;
            repoList = messageRepo.GetMessagesForMember(user).ToList();


            //Assert
            // Assert.Equal(repoList[0].From.Email, messages[0].From.Email);
        }