public void TryGetMethodInvokeCommandDoesNotContainMethodInvokeCommandReturnsFalse()
        {
            var sut = new SutAlias();
            MethodInvokeCommand methodInvokeCommand;

            var actual = sut.TryGetMethodInvokeCommand(
                new Mock <IGuardClauseCommand>().Object,
                out methodInvokeCommand);

            Assert.False(actual);
            Assert.Null(methodInvokeCommand);
        }
        public void TryGetMethodInvokeCommandHasMethodInvokeCommandReturnsCommand()
        {
            var sut = new SutAlias();
            MethodInvokeCommand methodInvokeCommand;
            var command = CreateWrappedMethodInvokeCommand(
                new Mock <IMethod>().Object,
                new Mock <IExpansion <object> >().Object);

            var actual = sut.TryGetMethodInvokeCommand(command, out methodInvokeCommand);

            Assert.True(actual);
            Assert.NotNull(methodInvokeCommand);
        }
        public void TryGetMethodInvokeCommandHasTaskTypeMethodInvokeCommandReturnsCommand()
        {
            var sut = new SutAlias();
            var testHelperMethod = typeof(GuardClauseExtensionsTests)
                                   .GetMethod(
                nameof(StaticCommandHelperMethod),
                BindingFlags.Static | BindingFlags.NonPublic);
            var innerCommand = new ReflectionExceptionUnwrappingCommand(new MethodInvokeCommand(
                                                                            new Mock <IMethod>().Object,
                                                                            new Mock <IExpansion <object> >().Object,
                                                                            testHelperMethod.GetParameters().First()));
            var command =
                (IGuardClauseCommand)Activator.CreateInstance(TaskReturnType, innerCommand);
            MethodInvokeCommand methodInvokeCommand;

            var actual = sut.TryGetMethodInvokeCommand(command, out methodInvokeCommand);

            Assert.True(actual);
            Assert.NotNull(methodInvokeCommand);
        }