public void Sut_ShouldReturnCorrectValue( [Frozen]Mock<ISettingsService> settingsService, ConfigurationObservable sut, TestScheduler scheduler, MusicMirrorConfiguration expected) { //arrange settingsService.Setup(s => s.ObserveValue(ConfigurationObservable.SourcePathKey, It.IsAny<Func<string>>())) .Returns(scheduler.CreateColdObservable(OnNext(0, expected.SourcePath.FullName))); settingsService.Setup(s => s.ObserveValue(ConfigurationObservable.TargetPathKey, It.IsAny<Func<string>>())) .Returns(scheduler.CreateColdObservable(OnNext(0, expected.TargetPath.FullName))); //act var result = scheduler.Start(() => sut); //assert result.Values().First().Should().Be(expected); }
public void Sut_WhenUsingDefaultValue_ShouldReturnCorrectValue( [Frozen]Mock<ISettingsService> settingsService, ConfigurationObservable sut, TestScheduler scheduler ) { //arrange settingsService.Setup(s => s.ObserveValue(ConfigurationObservable.SourcePathKey, It.IsAny<Func<string>>())) .Returns<string, Func<string>>((key, defaultValue) => scheduler.CreateColdObservable( OnNext(0, defaultValue()) )); settingsService.Setup(s => s.ObserveValue(ConfigurationObservable.TargetPathKey, It.IsAny<Func<string>>())) .Returns<string, Func<string>>((key, defaultValue) => scheduler.CreateColdObservable( OnNext(0, defaultValue()) )); var expected = new MusicMirrorConfiguration(null, null, NonTranscodingFilesBehavior.Copy); //act var result = scheduler.Start(() => sut); //assert result.Values().First().ShouldBeEquivalentTo(expected); }
public void Sut_IsIObservable( ConfigurationObservable sut) { sut.Should().BeAssignableTo<IObservable<MusicMirrorConfiguration>>(); }