public void IsTranscodingRunning_WhenSynchronizationIsDisabled_ShouldReturnCorrectValue(
     [Frozen]TestSchedulers schedulers,
     [Frozen]Mock<ITranscodingNotifications> notifications,
     ConfigurationPageViewModel sut)
 {
     //act
     var actual = schedulers.Start(() => sut.IsTranscodingRunning);
     //assert
     var expected = new[]
     {
         OnNext(200, false)
     };
     actual.Messages.ShouldAllBeEquivalentTo(expected);
 }
Esempio n. 2
0
 public TestContext(Composer composer, TestFilesRepository testFilesRepository, string testFolder)
 {
     if (composer == null) throw new ArgumentNullException(nameof(composer));
     if (string.IsNullOrWhiteSpace(testFolder)) throw new ArgumentNullException(nameof(testFolder));
     _viewModel = composer.Compose();
     _composer = composer;
     _rootFolder = testFolder;
     _sourceDirectory = Path.Combine(_rootFolder, "Source");
     _targetDirectory = Path.Combine(_rootFolder, "Target");
     _testFilesRepository = testFilesRepository;
     if (!Directory.Exists(SourceDirectory)) { Directory.CreateDirectory(SourceDirectory); }
     if (!Directory.Exists(TargetDirectory)) { Directory.CreateDirectory(TargetDirectory); }
     _logger = _composer.Resolve<Func<string, ILogger>>()("TestContext");
     _logger.Info("Root folder is " + _rootFolder);
     _logger.Info("Test context hashcode is " + GetHashCode());
 }
        public void SynchronizedFileCount_WhenNoFileIsTranscoding_ShouldReturnCorrectValue(
            [Frozen]TestSchedulers schedulers,
            [Frozen]Mock<ITranscodingNotifications> notifications,
            ConfigurationPageViewModel sut)
        {
            //arrange
            var notificationsObservable = schedulers.CreateHotObservable<bool>();
            notifications.Setup(n => n.ObserveIsTranscodingRunning()).Returns(notificationsObservable);

            //act
            var actual = schedulers.Start(() => sut.SynchronizedFileCount);
            //assert
            var expected = new[]
            {
                OnNext(200, SynchronizedFilesCountViewModel.Empty)
            };
            actual.Messages.ShouldAllBeEquivalentTo(expected);
        }