public void CanExecute_ShouldReturnPredicateValue(
            bool expected)
        {
            //arrange
            var sut = new SingleExecutionCanExecuteStrategy <object>(_ => expected);

            //act
            var actual = sut.CanExecute(null);

            //assert
            actual.Should().Be(expected);
        }
        public void CanExecute_WhenCallingExecuting_ShouldReturnFalse(
            SingleExecutionCanExecuteStrategy <object> sut)
        {
            //arrange
            sut.NotifyExecuting(null);

            //act
            var actual = sut.CanExecute(null);

            //assert
            actual.Should().BeFalse();
        }
        public void CanExecute_WhenCallingExecutingAndCanExecuteWithAnotherParameter_ShouldReturnFalse(
            SingleExecutionCanExecuteStrategy <object> sut,
            object parameter)
        {
            //arrange
            sut.NotifyExecuting(null);

            //act
            var actual = sut.CanExecute(parameter);

            //assert
            actual.Should().BeFalse();
        }
        public void CanExecute_WhenCallingWithDifferentParameters_ShouldReturnFalse(
            SingleExecutionCanExecuteStrategy <object> sut,
            object parameter1,
            object parameter2)
        {
            //arrange
            sut.NotifyExecuting(null);
            sut.NotifyNotExecuting(parameter1);

            //act
            var actual = sut.CanExecute(parameter2);

            //assert
            actual.Should().BeTrue();
        }
		public void NotifyExecuting_WithNullParameter_ShouldRaiseCanExecuteChanged(
			bool isExecuting,
			[Frozen]TestScheduler scheduler,
		  SingleExecutionCanExecuteStrategy<object> sut)
		{
			//arrange
			var observer = scheduler.CreateObserver<Unit>();
			sut.CanExecuteChanged.Subscribe(observer);

			//act
			sut.NotifyExecuting(null);

			//assert
			observer.Values().Should().HaveCount(1);
		}
        public void NotifyExecuting_WithNullParameter_ShouldRaiseCanExecuteChanged(
            bool isExecuting,
            [Frozen] TestScheduler scheduler,
            SingleExecutionCanExecuteStrategy <object> sut)
        {
            //arrange
            var observer = scheduler.CreateObserver <Unit>();

            sut.CanExecuteChanged.Subscribe(observer);

            //act
            sut.NotifyExecuting(null);

            //assert
            observer.Values().Should().HaveCount(1);
        }
 public void Sut_IsDisposable(
     SingleExecutionCanExecuteStrategy <object> sut)
 {
     sut.Should().BeAssignableTo <IDisposable>();
 }
 public void Sut_IsCanExecuteStrategy(
     SingleExecutionCanExecuteStrategy <object> sut)
 {
     sut.Should().BeAssignableTo <ICanExecuteStrategy <object> >();
 }
		public void Sut_IsDisposable(
			SingleExecutionCanExecuteStrategy<object> sut)
		{
			sut.Should().BeAssignableTo<IDisposable>();
		}
		public void Sut_IsCanExecuteStrategy(
		  SingleExecutionCanExecuteStrategy<object> sut)
		{
			sut.Should().BeAssignableTo<ICanExecuteStrategy<object>>();
		}
		public void CanExecute_WhenCallingWithDifferentParameters_ShouldReturnFalse(
		  SingleExecutionCanExecuteStrategy<object> sut,
			object parameter1,
			object parameter2)
		{
			//arrange
			sut.NotifyExecuting(null);
			sut.NotifyNotExecuting(parameter1);

			//act
			var actual = sut.CanExecute(parameter2);

			//assert
			actual.Should().BeTrue();
		}
		public void CanExecute_WhenCallingNotExecuting_ShouldReturnFalse(
		  SingleExecutionCanExecuteStrategy<object> sut)
		{
			//arrange
			sut.NotifyExecuting(null);
			sut.NotifyNotExecuting(null);

			//act
			var actual = sut.CanExecute(null);

			//assert
			actual.Should().BeTrue();
		}
		public void CanExecute_WhenCallingExecutingAndCanExecuteWithAnotherParameter_ShouldReturnFalse(
		  SingleExecutionCanExecuteStrategy<object> sut,
			object parameter)
		{
			//arrange
			sut.NotifyExecuting(null);

			//act
			var actual = sut.CanExecute(parameter);

			//assert
			actual.Should().BeFalse();
		}
		public void CanExecute_ShouldReturnPredicateValue(
		 bool expected)
		{
			//arrange
			var sut = new SingleExecutionCanExecuteStrategy<object>(_ => expected);

			//act
			var actual = sut.CanExecute(null);

			//assert
			actual.Should().Be(expected);
		}