Exemplo n.º 1
0
        public void GIVEN_collection_not_travelers_pay_WHEN_close_THEN_obtain_exception()
        {
            Collection collection = CollectionFake.GetEmptyCollection();

            collection.AddEntry(1, DateTime.Now, 50M);
            collection.AddEntry(2, DateTime.Now, 50M);

            mockTravelerRepository.Setup(x => x.GetAllAsync()).ReturnsAsync(TravelerFake.GetTravelers(3));
            mockCollectionRepository.Setup(x => x.GetByIdAsync(It.IsAny <int>())).ReturnsAsync(collection);

            Assert.That(() => sut.CloseCollection(1), Throws.Exception.TypeOf <AreMissingTravelersToPayException>());
        }