예제 #1
0
 /// <summary>
 /// ctor
 /// </summary>
 /// <param name="listLogic"></param>
 /// <param name="profileLogic"></param>
 /// <param name="logRepo"></param>
 public RecentItemController(IListLogic listLogic, IUserProfileLogic profileLogic, IRecentlyViewedListLogic recentlyViewedLogic,
                             IRecentlyOrderedListLogic recentlyOrderedLogic, IListService listService, IEventLogRepository logRepo)  : base(profileLogic)
 {
     _repo = listLogic;
     _recentlyViewedLogic  = recentlyViewedLogic;
     _recentlyOrderedLogic = recentlyOrderedLogic;
     _listService          = listService;
     _log = logRepo;
 }
예제 #2
0
            public void BadCustomerId_ReturnsNull()
            {
                // arrange
                IRecentlyOrderedListLogic testunit    = MakeTestsObject();
                UserSelectedContext       testcontext = new UserSelectedContext {
                    BranchId   = "FUT",
                    CustomerId = "223456"
                };
                UserProfile fakeUser   = new UserProfile();
                bool        headerOnly = false;

                // act
                ListModel results = testunit.ReadList(fakeUser, testcontext, headerOnly);

                // assert
                results.Should()
                .BeNull();
            }
예제 #3
0
            public void GoodCustomerIdAndBranch_ReturnsExpectedList()
            {
                // arrange
                IRecentlyOrderedListLogic testunit    = MakeTestsObject();
                UserSelectedContext       testcontext = new UserSelectedContext {
                    BranchId   = "FUT",
                    CustomerId = "123456"
                };
                int         expectedListId = 1;
                UserProfile fakeUser       = new UserProfile();
                bool        headerOnly     = false;

                // act
                ListModel results = testunit.ReadList(fakeUser, testcontext, headerOnly);

                // assert
                results.ListId
                .Should()
                .Be(expectedListId);
            }