public void CanExecute_AfterExecuteTargetGarbageCollected_ReturnsFalse<T>(T parameter) { var command = Command.WithGarbageCollectableExecuteTarget<T>(_ => Task.CompletedTask); GC.Collect(); Assert_CanExecute_WithParameter_ReturnsExpectedValue(command, parameter, false); }
public void CanExecuteGeneric_AfterExecuteTargetGarbageCollected_ReturnsFalse<T>(T parameter) { var command = Command.WithGarbageCollectableExecuteTarget<T>(_ => Task.CompletedTask); GC.Collect(); var result = command.CanExecute(parameter); Assert.False(result); }
public async Task ExecuteAsync_AfterExecuteTargetGarbageCollected_DoesNotExecute <T>(T parameter) { var execute = Execute.Create <T>(); var command = Command.WithGarbageCollectableExecuteTarget(execute); GC.Collect(); await command.ExecuteAsync(parameter); await execute.DidNotReceive().Invoke(Arg.Any <T>()); }
public void Execute_AfterExecuteTargetGarbageCollected_DoesNotExecute() { var execute = Execute.Create(); var command = Command.WithGarbageCollectableExecuteTarget(execute); GC.Collect(); command.Execute(null); execute.DidNotReceive().Invoke(); }
public void ExecuteGeneric_AfterExecuteTargetGarbageCollected_DoesNotExecute <T>(T parameter) { var execute = Execute.Create <T>(); var command = Command.WithGarbageCollectableExecuteTarget(execute); GC.Collect(); command.Execute(parameter); execute.DidNotReceive().Invoke(Arg.Any <T>()); }