コード例 #1
0
        public void CanExecute_AfterExecuteTargetGarbageCollected_ReturnsFalse<T>(T parameter)
        {
            var command = Command.WithGarbageCollectableExecuteTarget<T>(_ => Task.CompletedTask);

            GC.Collect();

            Assert_CanExecute_WithParameter_ReturnsExpectedValue(command, parameter, false);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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>());
        }
コード例 #4
0
        public void Execute_AfterExecuteTargetGarbageCollected_DoesNotExecute()
        {
            var execute = Execute.Create();
            var command = Command.WithGarbageCollectableExecuteTarget(execute);

            GC.Collect();

            command.Execute(null);

            execute.DidNotReceive().Invoke();
        }
コード例 #5
0
        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>());
        }