Пример #1
0
        public async Task GetAllBids_CallsRepositoryGetAllBidsWithCorrectArguments()
        {
            //arrange
            var groupCode = 1;
            var auctionId = 1;
            var mockRepo  = new Mock <IAuctionsRepository>();

            mockRepo.Setup(repo => repo.GetAllBids(groupCode, auctionId)).Returns(Task.FromResult((IList <Bid>)null)).Verifiable();
            var userStoreMock   = new Mock <IUserStore <AppUser> >();
            var userManagerMock = new Mock <UserManager <AppUser> >(userStoreMock.Object, null, null, null, null, null, null, null, null);
            var auctions        = new Auctions(mockRepo.Object, userManagerMock.Object);
            //act
            await auctions.GetAllBids(auctionId, groupCode);

            //assert
            mockRepo.Verify(repo => repo.GetAllBids(groupCode, auctionId));
        }