public void SchedulerController_Should_save_scheduled_image_entity()
        {
            // Arrange
            var controller = new SchedulerController(_context, _client, _postNotificationSender);

            // Act
            controller.Post(new AssetApiModel()
            {
                FileName = "foo",
                Url      = "bar"
            });

            // Assert
            Mock.Get(_scheduledImages).Verify(x => x.Add(It.Is <ScheduledImage>(img => img.FileName == "foo")), "Filename is different from expected.");
            Mock.Get(_scheduledImages).Verify(x => x.Add(It.Is <ScheduledImage>(img => img.CreatedDate != DateTime.MinValue)), "Date was not set.");
        }
        public void SchedulerController_Should_start_background_process_on_post()
        {
            // Arrange
            Mock.Get(_scheduledImages)
            .Setup(si => si.Add(It.IsAny <ScheduledImage>()))
            .Callback <ScheduledImage>((img) =>
            {
                img.Id = 3;
            });

            var controller = new SchedulerController(_context, _client, _postNotificationSender);

            // Act
            controller.Post(new AssetApiModel()
            {
                FileName = "foo", Url = "bar"
            });

            // Assert
            Mock.Get(_client).Verify(x => x.Create(
                                         It.Is <Job>(job => job.Method.Name == "DownloadAndReadMetadata" && Convert.ToInt32(job.Args[0]) == 3),
                                         It.IsAny <EnqueuedState>()));
        }