Example #1
0
        public async STT.Task ResetTest()
        {
            var mock   = new M.Mock <IOperation>();
            var option = new AO.Reset();

            mock.Setup(op => op.Reset(M.It.IsAny <AO.Reset>())).Returns(A.Utility.TaskExitSuccess);
            Assert.Equal(ExitCode.Success, await AT.Utility.FromOk(option.Operate(mock.Object)).ConfigureAwait(false));
            mock.Verify(op => op.Reset(option));
        }
Example #2
0
        public async STT.Task OperateTest(uint index)
        {
            var mock = new M.Mock <IOperation>();
            var maybePossibleOption = External.Parse(Configuration, $@"alias{index}");
            var option = AT.Utility.FromOk(AT.Utility.FromJust(maybePossibleOption));

            mock.Setup(op => op.External(M.It.IsAny <External>()))
            .Returns(Utility.TaskExitSuccess);
            Assert.Equal(ExitCode.Success, await AT.Utility.FromOk(option.Operate(mock.Object)).ConfigureAwait(false));
            mock.Verify(op => op.External(option));
        }