public void CanExecute_AfterCanExecuteTargetGarbageCollected_ReturnsFalse<T>(T parameter) { var command = Command.WithGarbageCollectableCanExecuteTarget<T>(_ => Task.CompletedTask, _ => true); GC.Collect(); Assert_CanExecute_WithParameter_ReturnsExpectedValue(command, parameter, false); }
public void CanExecuteGeneric_AfterCanExecuteTargetGarbageCollected_ReturnsFalse<T>(T parameter) { var command = Command.WithGarbageCollectableCanExecuteTarget<T>(_ => Task.CompletedTask, _ => true); GC.Collect(); var result = command.CanExecute(parameter); Assert.False(result); }
public void Execute_AfterCanExecuteTargetGarbageCollected_DoesNotExecute() { var execute = Execute.Create(); var command = Command.WithGarbageCollectableCanExecuteTarget(execute, () => true); GC.Collect(); command.Execute(null); execute.DidNotReceive().Invoke(); }
public async Task ExecuteAsync_AfterCanExecuteTargetGarbageCollected_DoesNotExecute <T>(T parameter) { var execute = Execute.Create <T>(); var command = Command.WithGarbageCollectableCanExecuteTarget(execute, _ => true); GC.Collect(); await command.ExecuteAsync(parameter); await execute.DidNotReceive().Invoke(Arg.Any <T>()); }
public async Task ExecuteAsync_AfterCanExecuteTargetGarbageCollected_DoesNotExecute() { var execute = Execute.Create(); var command = Command.WithGarbageCollectableCanExecuteTarget(execute, () => true); GC.Collect(); await command.ExecuteAsync(null); await execute.DidNotReceive().Invoke(); }
public void ExecuteGeneric_AfterCanExecuteTargetGarbageCollected_DoesNotExecute <T>(T parameter) { var execute = Execute.Create <T>(); var command = Command.WithGarbageCollectableCanExecuteTarget(execute, _ => true); GC.Collect(); command.Execute(parameter); execute.DidNotReceive().Invoke(Arg.Any <T>()); }