public void TestGetSummary()
        {
            User user1 = new User()
            {
                UserSummary = new Summary()
                {
                    Name = "summary1"
                }
            };
            User user2 = new User()
            {
                UserSummary = new Summary()
                {
                    Name = "summary2"
                }
            };
            User user3 = new User()
            {
                UserSummary = new Summary()
                {
                    Name = "summary3"
                }
            };
            List <User> users = new List <User>()
            {
                user1, user2, user3
            };

            mockUnitOfWork     = kernel.Get <IUnitOfWork>();
            mockUserRepository = kernel.Get <IGenericRepository <User> >();
            mockUserRepository.Get().Returns(users);
            mockUnitOfWork.UsersRepository.Returns(mockUserRepository);

            presentSubSys = new PresentSubSystem(mockUnitOfWork);

            List <SummaryBLL> expected = new List <SummaryBLL>()
            {
                CustomMapper.getSummaryBLL(user1.UserSummary), CustomMapper.getSummaryBLL(user2.UserSummary), CustomMapper.getSummaryBLL(user3.UserSummary)
            };
            List <SummaryBLL> real = (List <SummaryBLL>)presentSubSys.GetSummary();

            Assert.AreEqual(expected, real);
        }
Ejemplo n.º 2
0
 public ICollection <SummaryBLL> getSummaries()
 {
     return(presentSystem.GetSummary());
 }