public void NotifyNotExecuting_ShouldCallInner( [Frozen] Mock <ICanExecuteStrategy <object> > inner, ObserveCanExecuteStrategy <object> sut, object arg) { //arrange //act sut.NotifyNotExecuting(arg); //assert inner.Verify(c => c.NotifyNotExecuting(arg)); }
public void NotifyExecuting_ShouldCallInner( [Frozen]Mock<ICanExecuteStrategy<object>> inner, ObserveCanExecuteStrategy<object> sut, object arg) { //arrange //act sut.NotifyExecuting(arg); //assert inner.Verify(c => c.NotifyExecuting(arg)); }
public void CanExecute_WhenObservableIsFalse_ShouldReturnFalse( [Frozen] Subject <bool> canExecuteObservable, ObserveCanExecuteStrategy <object> sut, object arg) { //arrange canExecuteObservable.OnNext(false); //act var actual = sut.CanExecute(arg); //assert actual.Should().BeFalse(); }
public void CanExecute_WhenObservableHasNoValue_ShouldReturnInner( [Frozen] Mock <ICanExecuteStrategy <object> > inner, ObserveCanExecuteStrategy <object> sut, object arg) { //arrange inner.Setup(i => i.CanExecute(arg)).Returns(true); //act var actual = sut.CanExecute(arg); //assert actual.Should().BeTrue(); }
public void CanExecute_WhenObservableIsTrue_ShouldReturnInner( [Frozen] Subject <bool> canExecuteObservable, [Frozen] Mock <ICanExecuteStrategy <object> > inner, ObserveCanExecuteStrategy <object> sut, object arg) { //arrange inner.Setup(i => i.CanExecute(arg)).Returns(false); canExecuteObservable.OnNext(true); //act var actual = sut.CanExecute(arg); //assert actual.Should().BeFalse(); }
public void CanExecuteChanged_WhenObservableYieldValue_ShouldYieldValue( [Frozen] Subject <bool> canExecuteObservable, [Frozen] Mock <ICanExecuteStrategy <object> > inner, ObserveCanExecuteStrategy <object> sut, TestSchedulers schedulers, object arg) { //arrange var observer = schedulers.CreateObserver <Unit>(); sut.CanExecuteChanged.Subscribe(observer); //act canExecuteObservable.OnNext(true); //assert observer.Values().Should().HaveCount(1); }
public void Sut_ShouldBeCanExecuteStrategy( ObserveCanExecuteStrategy <object> sut) { sut.Should().BeAssignableTo <ICanExecuteStrategy <object> >(); }
public void Sut_ShouldBeCanExecuteStrategy( ObserveCanExecuteStrategy<object> sut) { sut.Should().BeAssignableTo<ICanExecuteStrategy<object>>(); }
public void CanExecuteChanged_WhenObservableYieldValue_ShouldYieldValue( [Frozen]Subject<bool> canExecuteObservable, [Frozen]Mock<ICanExecuteStrategy<object>> inner, ObserveCanExecuteStrategy<object> sut, TestSchedulers schedulers, object arg) { //arrange var observer = schedulers.CreateObserver<Unit>(); sut.CanExecuteChanged.Subscribe(observer); //act canExecuteObservable.OnNext(true); //assert observer.Values().Should().HaveCount(1); }
public void CanExecute_WhenObservableIsTrue_ShouldReturnInner( [Frozen]Subject<bool> canExecuteObservable, [Frozen]Mock<ICanExecuteStrategy<object>> inner, ObserveCanExecuteStrategy<object> sut, object arg) { //arrange inner.Setup(i => i.CanExecute(arg)).Returns(false); canExecuteObservable.OnNext(true); //act var actual = sut.CanExecute(arg); //assert actual.Should().BeFalse(); }
public void CanExecute_WhenObservableIsFalse_ShouldReturnFalse( [Frozen]Subject<bool> canExecuteObservable, ObserveCanExecuteStrategy<object> sut, object arg) { //arrange canExecuteObservable.OnNext(false); //act var actual = sut.CanExecute(arg); //assert actual.Should().BeFalse(); }
public void CanExecute_WhenObservableHasNoValue_ShouldReturnInner( [Frozen]Mock<ICanExecuteStrategy<object>> inner, ObserveCanExecuteStrategy<object> sut, object arg) { //arrange inner.Setup(i => i.CanExecute(arg)).Returns(true); //act var actual = sut.CanExecute(arg); //assert actual.Should().BeTrue(); }