コード例 #1
0
        public bool TurnOff(ushort channel)
        {
            GetApi <IPowerSupplyApi>().TurnOff(channel);
            PowerStateValidator powerStateValidator = new PowerStateValidator(expectedValue: true);
            bool outputState = GetApi <IPowerSupplyApi>().GetOutputState(channel);

            powerStateValidator.ValidateAndThrow(outputState);
            return(true);
        }
コード例 #2
0
        public bool TurnOn(ushort channel)
        {
            Log.Debug($"Enter method {MethodBase.GetCurrentMethod().Name} with args :{channel}");
            GetApi <IPowerSupplyApi>().TurnOn(channel);
            bool outputState = GetApi <IPowerSupplyApi>().GetOutputState(channel);
            PowerStateValidator powerStateValidator = new PowerStateValidator(expectedValue: true);
            var res = powerStateValidator.Validate(outputState);

            return(true);
        }