示例#1
0
            public void BadCustomerId_ReturnsNull()
            {
                // arrange
                IFavoritesListLogic testunit    = MakeTestsUnit();
                UserSelectedContext testcontext = new UserSelectedContext {
                    BranchId   = "FUT",
                    CustomerId = "223456"
                };
                UserProfile fakeUser = new UserProfile();

                // act
                ListModel results = testunit.GetFavoritesList(fakeUser.UserId, testcontext, true);

                // assert
                results.Should()
                .BeNull();
            }
示例#2
0
            public void GoodCustomerIdAndBranchHeaderOnly_ReturnsListWithExpectedId()
            {
                // arrange
                IFavoritesListLogic testunit    = MakeTestsUnit();
                UserSelectedContext testcontext = new UserSelectedContext {
                    BranchId   = "FUT",
                    CustomerId = "123456"
                };
                UserProfile fakeUser   = new UserProfile();
                int         expectedId = 1;

                // act
                ListModel results = testunit.GetFavoritesList(fakeUser.UserId, testcontext, true);

                // assert
                results.ListId
                .Should()
                .Be(expectedId);
            }
示例#3
0
            public void GoodCustomerIdAndBranch_ReturnsListWithAnItem()
            {
                // arrange
                IFavoritesListLogic testunit    = MakeTestsUnit();
                UserSelectedContext testcontext = new UserSelectedContext {
                    BranchId   = "FUT",
                    CustomerId = "123456"
                };
                UserProfile fakeUser      = new UserProfile();
                int         expectedCount = 1;

                // act
                ListModel results = testunit.GetFavoritesList(fakeUser.UserId, testcontext, false);

                // assert
                results.Items
                .Count()
                .Should()
                .Be(expectedCount);
            }