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

                // act
                ListModel results = testunit.GetListModel(fakeUser, testcontext, fakeId);

                // 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;
                int         fakeId     = 0;

                // act
                ListModel results = testunit.GetListModel(fakeUser, testcontext, fakeId);

                // assert
                results.ListId
                .Should()
                .Be(expectedId);
            }
예제 #3
0
            public void GoodCustomerIdAndBranch_ReturnsListExpectedItemNumber()
            {
                // arrange
                IFavoritesListLogic testunit    = MakeTestsUnit();
                UserSelectedContext testcontext = new UserSelectedContext {
                    BranchId   = "FUT",
                    CustomerId = "123456"
                };
                UserProfile fakeUser = new UserProfile();
                string      expected = "123456";
                int         fakeId   = 0;

                // act
                ListModel results = testunit.GetListModel(fakeUser, testcontext, fakeId);

                // assert
                results.Items
                .First()
                .ItemNumber
                .Should()
                .Be(expected);
            }