Ejemplo n.º 1
0
        public async Task Then_The_Command_Is_Handled_And_Service_Called(
            DeleteShortlistItemForUserCommand command,
            [Frozen] Mock <IShortlistService> service,
            DeleteShortlistItemForUserCommandHandler handler)
        {
            //Act
            await handler.Handle(command, CancellationToken.None);

            //Assert
            service.Verify(x => x.DeleteShortlistItemForUser(command.Id, command.ShortlistUserId));
        }
Ejemplo n.º 2
0
        public async Task Then_Deletes_The_Shortlist_Item_From_The_Request_Calling_CourseDelivery_Api(
            DeleteShortlistItemForUserCommand command,
            [Frozen] Mock <ICourseDeliveryApiClient <CourseDeliveryApiConfiguration> > courseDeliveryApiClient,
            DeleteShortlistItemForUserCommandHandler handler)
        {
            //Act
            await handler.Handle(command, CancellationToken.None);

            //Assert
            courseDeliveryApiClient.Verify(x =>
                                           x.Delete(It.Is <DeleteShortlistItemForUserRequest>(c =>
                                                                                              c.DeleteUrl.Equals($"api/shortlist/users/{command.UserId}/items/{command.Id}"))), Times.Once);
        }