Beispiel #1
0
 public void ReturnsTrueWhenAPageBoundaryWasCrossed(AddressingMode mode,
                                                 RegisterName register)
 {
     model.GetRegister(register).SetValue(0x10);
       Assert.That(ArgumentUtils.CrossesPageBoundary(model, mode, 0x10F0),
           Is.True, "A page boundary was crossed, but not noticed.");
 }
Beispiel #2
0
        public Mv(RegisterName toLoad, RegisterName destination, RegisterName ignored = 0)
        {
            // we re-use the 3 register format and having 1 ignored param makes the parser easier.

            this.toLoad = toLoad;
            this.destination = destination;
        }
    public void ReturnFromRegistration()
    {
        HeadingText.GetComponent <TextMeshProUGUI>().text = "User Login";
        LoginButton.SetActive(true);
        LoginButtonCover.SetActive(true);
        UserLoginText.SetActive(true);
        PasswordText.SetActive(true);
        RegisterButton.SetActive(true);
        //RegisterName, RegisterPassword, RegisterLocation, RegisterAge, SubmitCoverButton, SubmitButton;
        RegisterName.SetActive(false);
        RegisterPassword.SetActive(false);
        RegisterLocation.SetActive(false);
        RegisterAge.SetActive(false);
        SubmitCoverButton.SetActive(false);
        SubmitButton.SetActive(false);
        Registering = false;

        if (netManager)
        {
            if (netManager.IsConnectedToServer())
            {
                netManager.AttemptAccountCreation(RegisterName.GetComponent <TMP_InputField>().text, RegisterPassword.GetComponent <TMP_InputField>().text);
            }
        }
    }
Beispiel #4
0
 private Register(RegisterName register, RegisterFlags flags, RegisterSize size, RegisterName?containing = null)
 {
     RegisterName = register;
     Flags        = flags;
     Size         = size;
     Containing   = containing;
 }
    // Update is called once per frame
    void Update()
    {
        if (!loggingIn && !loggedIn && !Registering)
        {
            if (UserLoginText.GetComponent <TMP_InputField>().text != "" &&
                PasswordText.GetComponent <TMP_InputField>().text != "")
            {
                LoginButton.SetActive(true);
                LoginButtonCover.SetActive(false);
            }
            else
            {
                LoginButton.SetActive(false);
                LoginButtonCover.SetActive(true);
            }
        }

        if (Registering)
        {
            if (RegisterName.GetComponent <TMP_InputField>().text != "" &&
                RegisterPassword.GetComponent <TMP_InputField>().text != "" &&
                RegisterAge.GetComponent <TMP_InputField>().text != "" &&
                RegisterLocation.GetComponent <TMP_InputField>().text != "")
            {
                SubmitCoverButton.SetActive(false);
                SubmitButton.SetActive(true);
            }
            else
            {
                SubmitCoverButton.SetActive(true); SubmitButton.SetActive(false);
            }
        }


        if (loggingIn)
        {
            if (loginConfirmed)
            {
                fakeLoginCount++;
                if (fakeLoginCount > 180)
                {
                    LoggedIn();
                    loggingIn      = false;
                    fakeLoginCount = 0;
                }
            }
        }

        if (loginFailed)
        {
            errorCount++;
            if (errorCount > 250)
            {
                loginFailed = false;
                errorCount  = 0;
                ErrorMessageBacking.SetActive(false);
                ErrorMessageText.SetActive(false);
            }
        }
    }
Beispiel #6
0
 public void ReturnsFalseWhenAPageBoundaryWasNotCrossed(AddressingMode mode,
                                                     RegisterName register)
 {
     model.GetRegister(register).SetValue(0x10);
       Assert.That(ArgumentUtils.CrossesPageBoundary(model, mode, 0x10E0), Is.False,
           "We reported incorrectly that a page boundary was crossed.");
 }
Beispiel #7
0
        public NthInstruction(int index, RegisterName registerName)
        {
            // todo1[ak] check args

            this.Index = index;
            this.RegisterName = registerName;
        }
Beispiel #8
0
 public void ForZeropageIndexedMode(AddressingMode mode, RegisterName register)
 {
     memory.SetValue(0x0070, 0x8);
       model.GetRegister(register).SetValue(0x10);
       Assert.That(ArgumentUtils.ArgumentFor(model, memory, mode, 0x60),
           Is.EqualTo(0x8));
 }
        private void UpdateForPasteWait(WpfTextChangedEventArgs e)
        {
            Debug.Assert(InPasteWait);

            var command = _margin.CommandLineTextBox.Text ?? "";

            if (e.Changes.Count == 1 && command.Length > 0)
            {
                var change = e.Changes.First();
                if (change.AddedLength == 1)
                {
                    // If we are in a paste wait context then attempt to complete it by passing on the
                    // typed char to _vimBuffer.  This will process it as the register
                    var c        = command[change.Offset];
                    var keyInput = KeyInputUtil.CharToKeyInput(c);
                    _vimBuffer.Process(keyInput);

                    // Now we need to update the command line.  During edits the controller is responsible
                    // for manually updating the command line state.  Also we have to keep the caret postion
                    // correct
                    var name    = RegisterName.OfChar(c);
                    var toPaste = name.IsSome() ? _vimBuffer.GetRegister(name.Value).StringValue : string.Empty;
                    EndPasteWait(toPaste);

                    return;
                }
            }

            // The buffer was in a paste wait but the UI isn't in sync for completing
            // the operation.  Just pass Escape down to the buffer so it will cancel out
            // of paste wait and go back to a known state
            _vimBuffer.Process(KeyInputUtil.EscapeKey);
        }
Beispiel #10
0
 public void ReturnsTheProperNumberOfCyclesWhenNotCrossingPageBoundary(
 AddressingMode mode, RegisterName register)
 {
     model.GetRegister(register).SetValue(0x10);
       Assert.That(executor.Execute(opcode, mode, 0x10E0),
           Is.EqualTo(InstructionTestDouble.NumberOfCycles));
 }
Beispiel #11
0
 public void AllChars1()
 {
     foreach (var cur in RegisterNameUtil.RegisterNameChars)
     {
         var res = RegisterName.OfChar(cur);
         Assert.True(res.IsSome());
     }
 }
Beispiel #12
0
 internal static CommandData CreateCommandData(
     int?count         = null,
     RegisterName name = null)
 {
     return(new CommandData(
                FSharpOption.CreateForNullable(count),
                FSharpOption.CreateForReference(name)));
 }
Beispiel #13
0
        public void ModifyOtherThanX0Test()
        {
            var enums = new RegisterName[]
            {
                RegisterName.x1,
                RegisterName.x2,
                RegisterName.x3,
                RegisterName.x4,
                RegisterName.x5,
                RegisterName.x6,
                RegisterName.x7,
                RegisterName.x8,
                RegisterName.x9,
                RegisterName.x10,
                RegisterName.x11,
                RegisterName.x12,
                RegisterName.x13,
                RegisterName.x14,
                RegisterName.x15,
                RegisterName.x16,
                RegisterName.x17,
                RegisterName.x18,
                RegisterName.x19,
                RegisterName.x20,
                RegisterName.x21,
                RegisterName.x22,
                RegisterName.x23,
                RegisterName.x24,
                RegisterName.x25,
                RegisterName.x26,
                RegisterName.x27,
                RegisterName.x28,
                RegisterName.x29,
                RegisterName.x30,
                RegisterName.x31,
                RegisterName.x32,
            };

            // Write the values starting with 10
            uint value         = 10;
            int  expectedValue = 10;

            foreach (var curValue in enums)
            {
                register.WriteUnsignedInt(curValue, value);
                value++;
            }

            // Now again read all of them again and verify if they are all different!

            foreach (var curValue in enums)
            {
                var content = register.ReadUnsignedInt(curValue);
                Assert.AreEqual(content, expectedValue);

                expectedValue++;
            }
        }
Beispiel #14
0
        public MachineState DoOperation(RegisterName lhs, OperatorEffect operatorEffect, RegisterName rhs)
        {
            var newState = new MachineState(this);
            var result   = DoOperation(Registers[lhs], operatorEffect, Registers[rhs]);

            newState.Registers[lhs] = result.Value;
            newState.ZeroFlag       = result.ZeroFlag;
            return(newState);
        }
Beispiel #15
0
        private void MovingFromConstValue()
        {
            RegisterName destReg = ((AssemblerCommand.RegName)currentOpRands[0]).Value;
            BitValue     value   = ((AssemblerCommand.ConstValue)currentOpRands[1]).Value;

            ((StatusRegister)Parent.registers[RegisterName.PS]).SetValue(value.IsNegative);

            Parent.registers[destReg].SetValue(value);
        }
Beispiel #16
0
        private void MovingFromRegister()
        {
            RegisterName destReg   = ((AssemblerCommand.RegName)currentOpRands[0]).Value;
            RegisterName sourceReg = ((AssemblerCommand.RegName)currentOpRands[1]).Value;

            ((StatusRegister)Parent.registers[RegisterName.PS]).SetValue(Parent.registers[sourceReg].GetValue().IsNegative);

            Parent.registers[destReg].SetValue(new BitValue(Parent.registers[sourceReg].GetValue()));
        }
Beispiel #17
0
        public void SetRegisterValue_DeleteSingleLine()
        {
            var reg = _map.GetRegister('c');

            _map.SetRegisterValue(reg, RegisterOperation.Delete, RegisterValue.OfString("foo bar", OperationKind.CharacterWise));
            AssertRegister(reg, "foo bar", OperationKind.CharacterWise);
            AssertRegister(RegisterName.Unnamed, "foo bar", OperationKind.CharacterWise);
            AssertRegister(RegisterName.NewNumbered(NumberedRegister.Register_1), "foo bar", OperationKind.CharacterWise);
            AssertRegister(RegisterName.SmallDelete, "foo bar", OperationKind.CharacterWise);
        }
Beispiel #18
0
 private static ushort IndexedIndirectAddressFor(ProgrammingModel model,
                                             Memory memory,
                                             RegisterName register,
                                             ushort operand)
 {
     var zeroPageAddress = OffsetAddressFor(model, register, operand);
     var effectiveAddressLow = memory.GetValue(zeroPageAddress);
     var effectiveAddressHi = memory.GetValue((ushort)(zeroPageAddress + 1));
     return (ushort)(effectiveAddressHi << 8 | effectiveAddressLow);
 }
        public void CanSetTheValueInRegister(RegisterName name)
        {
            const int expectedValue = 42;

              var registerBeforeSet = model.GetRegister(name);
              registerBeforeSet.SetValue(expectedValue);

              var registerAfterSet = model.GetRegister(name);
              Assert.That(registerAfterSet.GetValue(), Is.EqualTo(expectedValue));
        }
Beispiel #20
0
 public Register(RegisterName name, Word value,
                 RegisterAccessRights internalRights =
                 RegisterAccessRights.Read | RegisterAccessRights.Write,
                 RegisterAccessRights externalRights =
                 RegisterAccessRights.Read | RegisterAccessRights.Write)
 {
     Name           = name;
     InternalRights = internalRights;
     ExternalRights = externalRights;
     Value          = value;
 }
Beispiel #21
0
        public static Payload MakeRegisterNamePayload(string registrant, string name, long registrationFee)
        {
            var registerName = new RegisterName
            {
                Registrant      = registrant.FromHexString(),
                Name            = name,
                RegistrationFee = registrationFee
            };

            return(TransactionFactory.MakePayload(registerName, PayloadType.RegisterName));
        }
Beispiel #22
0
 /// <summary>
 /// Calculates hash code based on the contained data.
 /// </summary>
 /// <returns>The hash code of the object.</returns>
 public override int GetHashCode()
 {
     return
         (DisplayName.GetHashCode() +
          Username.GetHashCode() +
          RegisterName.GetHashCode() +
          Password.GetHashCode() +
          Domain.GetHashCode() +
          Proxy.GetHashCode() +
          RegRequired.GetHashCode());
 }
        private void MakeNegation()
        {
            RegisterName destReg = ((AssemblerCommand.RegName)currentOpRands[0]).Value;

            BitValue value = new BitValue(Parent.registers[destReg].GetValue());

            value.Negate();

            Parent.registers[destReg].SetValue(value);
            ((StatusRegister)Parent.registers[RegisterName.PS]).SetValue(value.IsNegative);
        }
Beispiel #24
0
        private void AddingWithRegister()
        {
            RegisterName destReg   = ((AssemblerCommand.RegName)currentOpRands[0]).Value;
            RegisterName sourceReg = ((AssemblerCommand.RegName)currentOpRands[1]).Value;

            var curDestValue = Parent.registers[destReg].GetValue();

            curDestValue.Add(Parent.registers[sourceReg].GetValue());

            ((StatusRegister)Parent.registers[RegisterName.PS]).SetValue(curDestValue.IsNegative);

            Parent.registers[destReg].SetValue(curDestValue);
        }
Beispiel #25
0
            public void ForSpan_DeleteToBlackHole()
            {
                _map.GetRegister(RegisterName.Blackhole).UpdateValue("", OperationKind.CharacterWise);
                _map.GetRegister(RegisterName.NewNumbered(NumberedRegister.Number1)).UpdateValue("hey", OperationKind.CharacterWise);
                var namedReg = _map.GetRegister('c');

                _map.SetRegisterValue(namedReg, RegisterOperation.Yank, new RegisterValue("foo bar", OperationKind.CharacterWise));
                _map.SetRegisterValue(_map.GetRegister(RegisterName.Blackhole), RegisterOperation.Delete, new RegisterValue("foo bar", OperationKind.CharacterWise));
                AssertRegister(namedReg, "foo bar", OperationKind.CharacterWise);
                AssertRegister(RegisterName.Unnamed, "foo bar", OperationKind.CharacterWise);
                AssertRegister(RegisterName.NewNumbered(NumberedRegister.Number1), "hey", OperationKind.CharacterWise);
                AssertRegister(RegisterName.Blackhole, "", OperationKind.CharacterWise);
            }
Beispiel #26
0
        public StoreOff(RegisterName source, short offset, RegisterName destination)
        {
            var bytes = new byte[4];
            var shortBytes = BitConverter.GetBytes(offset);

            for (int i = 0; i < shortBytes.Length; i++)
                bytes[i] = shortBytes[i];

            var bytesAsUnsigned = BitConverter.ToUInt32(bytes, 0);

            this.source = source;
            this.offset = offset;
            this.offsetUnsigned = bytesAsUnsigned;
            this.destination = destination;
        }
 public void StartRegistration()
 {
     LoginButton.SetActive(false);
     LoginButtonCover.SetActive(false);
     UserLoginText.SetActive(false);
     PasswordText.SetActive(false);
     HeadingText.GetComponent <TextMeshProUGUI>().text = "Register New Profile";
     RegisterButton.SetActive(false);
     //RegisterName, RegisterPassword, RegisterLocation, RegisterAge, SubmitCoverButton, SubmitButton;
     RegisterName.SetActive(true);
     RegisterPassword.SetActive(true);
     RegisterLocation.SetActive(true);
     RegisterAge.SetActive(true);
     SubmitCoverButton.SetActive(true);
     Registering = true;
 }
Beispiel #28
0
        public void ReadTest1()
        {
            var enums = new RegisterName[]
            {
                RegisterName.x0,
                RegisterName.x1,
                RegisterName.x2,
                RegisterName.x3,
                RegisterName.x4,
                RegisterName.x5,
                RegisterName.x6,
                RegisterName.x7,
                RegisterName.x8,
                RegisterName.x9,
                RegisterName.x10,
                RegisterName.x11,
                RegisterName.x12,
                RegisterName.x13,
                RegisterName.x14,
                RegisterName.x15,
                RegisterName.x16,
                RegisterName.x17,
                RegisterName.x18,
                RegisterName.x19,
                RegisterName.x20,
                RegisterName.x21,
                RegisterName.x22,
                RegisterName.x23,
                RegisterName.x24,
                RegisterName.x25,
                RegisterName.x26,
                RegisterName.x27,
                RegisterName.x28,
                RegisterName.x29,
                RegisterName.x30,
                RegisterName.x31,
                RegisterName.x32,
            };

            // The initial value for all register is zero!
            foreach (var curValue in enums)
            {
                var initValue = register.ReadUnsignedInt(curValue);
                Assert.AreEqual(initValue, 0);
            }
        }
Beispiel #29
0
        public MachineState DoOperation(RegisterName lhs, Int32 index, OperatorEffect operatorEffect, AbstractValue rhs)
        {
            var newState = new MachineState(this);

            switch (operatorEffect)
            {
            case OperatorEffect.Assignment:
            case OperatorEffect.Cmp:
            {
                var result = DoOperation(Registers[lhs].PointsTo[index], operatorEffect, rhs);
                newState.Registers[lhs].PointsTo[index] = result.Value;
                newState.ZeroFlag = result.ZeroFlag;
                break;
            }
            }

            return(newState);
        }
Beispiel #30
0
        public MachineState DoOperation(RegisterName lhs, OperatorEffect operatorEffect, AbstractValue rhs)
        {
            var newState = new MachineState(this);

            if (Registers[lhs].IsPointer &&
                operatorEffect != OperatorEffect.Assignment)
            {
                var newBuffer = Registers[lhs].PointsTo.DoOperation(operatorEffect, rhs);
                newState.Registers[lhs] = new AbstractValue(newBuffer);
            }
            else
            {
                var result = DoOperation(Registers[lhs], operatorEffect, rhs);
                newState.Registers[lhs] = result.Value;
                newState.ZeroFlag       = result.ZeroFlag;
            }

            return(newState);
        }
Beispiel #31
0
        /// <summary>
        /// Equality comparer.
        /// </summary>
        /// <param name="obj">Meant to be other PhoneLineInfo object.</param>
        /// <returns>Returns true if the two objects are equal, otherwise false.</returns>
        public override bool Equals(object obj)
        {
            if (obj == this)
            {
                return(true);
            }

            PhoneLineInfo other = obj as PhoneLineInfo;

            if (other == null)
            {
                return(false);
            }

            return
                (DisplayName.Equals(other.DisplayName) &&
                 Username.Equals(other.Username) &&
                 RegisterName.Equals(other.RegisterName) &&
                 Password.Equals(other.Password) &&
                 Domain.Equals(other.Domain) &&
                 Proxy.Equals(other.Proxy) &&
                 RegRequired.Equals(other.RegRequired));
        }
Beispiel #32
0
        public static void SetupCommandMotion <T>(this Mock <ICommandUtil> commandUtil, int?count = null, RegisterName registerName = null) where T : NormalCommand
        {
            var realCount   = FSharpOption.CreateForNullable(count);
            var realName    = FSharpOption.CreateForReference(registerName);
            var commandData = new CommandData(realCount, realName);

            commandUtil
            .Setup(x => x.RunCommand(It.Is <Command>(c =>
                                                     c.IsNormalCommand &&
                                                     c.AsNormalCommand().Item1 is T)))
            .Returns(CommandResult.NewCompleted(ModeSwitch.NoSwitch))
            .Verifiable();
        }
Beispiel #33
0
 void AssertRegister(RegisterName name, string value, OperationKind kind)
 {
     AssertRegister(_registerMap.GetRegister(name), value, kind);
 }
Beispiel #34
0
 public Register GetRegister(RegisterName name)
 {
     throw new NotImplementedException();
 }
Beispiel #35
0
 private void SetLastCommand(NormalCommand command, int? count = null, RegisterName name = null)
 {
     var data = VimUtil.CreateCommandData(count, name);
     var storedCommand = StoredCommand.NewNormalCommand(command, data, CommandFlags.None);
     _vimData.LastCommand = FSharpOption.Create(storedCommand);
 }
Beispiel #36
0
 public Register GetRegister(RegisterName name)
 {
     throw new NotImplementedException();
 }
Beispiel #37
0
        public MachineState DoOperation(RegisterName lhs, OperatorEffect operatorEffect, AbstractValue rhs)
        {
            var newState = new MachineState(this);

            if (Registers[lhs].IsPointer &&
                operatorEffect != OperatorEffect.Assignment)
            {
                var newBuffer = Registers[lhs].PointsTo.DoOperation(operatorEffect, rhs);
                newState.Registers[lhs] = new AbstractValue(newBuffer);
            }
            else
            {
                var result = DoOperation(Registers[lhs], operatorEffect, rhs);
                newState.Registers[lhs] = result.Value;
                newState.ZeroFlag = result.ZeroFlag;
            }

            return newState;
        }
Beispiel #38
0
 public CarInstruction(RegisterName registerName)
 {
     this.RegisterName = registerName;
 }
 public AbstractValue this[RegisterName index]
 {
     get { return registers[(Int32)index]; }
     set { registers[(Int32)index] = value; }
 }
Beispiel #40
0
 public Register GetRegister(RegisterName name)
 {
     return registers[name];
 }
Beispiel #41
0
 public Div(RegisterName arg1, RegisterName arg2, RegisterName result)
 {
     this.result = result;
     this.arg2 = arg2;
     this.arg1 = arg1;
 }
Beispiel #42
0
 public Store(uint destination, RegisterName source)
 {
     this.source = source;
     this.destination = destination;
 }
Beispiel #43
0
 public TestInstruction(RegisterName registerName)
 {
     // todo1[ak] check args
     this.RegisterName = registerName;
 }
Beispiel #44
0
 public byte[] GetBytes(RegisterName name)
 {
     return BitConverter.GetBytes(registers[name]);
 }
Beispiel #45
0
 private byte[] Resolve(VmState state, int length, RegisterName source)
 {
     var bytes = BitConverter.GetBytes(state.registers[source]);
     return bytes;
 }
Beispiel #46
0
        public uint ReadUnsignedInt(RegisterName name)
        {
            var index = ToInt(name);

            return(ReadUnsignedInt(index));
        }
Beispiel #47
0
 public MachineState DoOperation(RegisterName lhs, OperatorEffect operatorEffect, RegisterName rhs)
 {
     var newState = new MachineState(this);
     var result = DoOperation(Registers[lhs], operatorEffect, Registers[rhs]);
     newState.Registers[lhs] = result.Value;
     newState.ZeroFlag = result.ZeroFlag;
     return newState;
 }
Beispiel #48
0
        public void WriteUnsignedInt(RegisterName name, uint value)
        {
            var index = ToInt(name);

            WriteUnsignedInt(index, value);
        }
Beispiel #49
0
        public MachineState DoOperation(RegisterName lhs, Int32 index, OperatorEffect operatorEffect, AbstractValue rhs)
        {
            var newState = new MachineState(this);

            switch (operatorEffect)
            {
                case OperatorEffect.Assignment:
                case OperatorEffect.Cmp:
                {
                    var result = DoOperation(Registers[lhs].PointsTo[index], operatorEffect, rhs);
                    newState.Registers[lhs].PointsTo[index] = result.Value;
                    newState.ZeroFlag = result.ZeroFlag;
                    break;
                }
            }

            return newState;
        }
Beispiel #50
0
 public Word this[RegisterName reg]
 {
     get { return(_registers[reg].Value); }
     set { _registers[reg].Value = value; }
 }
Beispiel #51
0
 private static ushort OffsetAddressFor(ProgrammingModel model,
                                     RegisterName register, ushort operand)
 {
     return (ushort)(operand + model.GetRegister(register).GetValue());
 }
Beispiel #52
0
 public Shr(RegisterName target, RegisterName source, RegisterName result)
 {
     this.target = target;
     this.source = source;
     this.result = result;
 }
Beispiel #53
0
 public void Register()
 {
     _runner.Run(@"""a");
     Assert.True(_runner.HasRegisterName);
     Assert.Equal(RegisterName.OfChar('a').Value, _runner.RegisterName);
 }
Beispiel #54
0
 public Load(uint source, RegisterName destination)
 {
     this.source = source;
     this.destination = destination;
 }
Beispiel #55
0
        public Push(RegisterName toPush, RegisterName ignored = 0, RegisterName ignored2 = 0)
        {
            // we re-use the 3 register format and having 2 ignored params makes the parser easier.

            this.toPush = toPush;
        }
Beispiel #56
0
 public MovInstruction(RegisterName to, object from)
 {
     this.To = to;
     this.From = from;
 }
Beispiel #57
0
        public static void SetupCommandNormal(this Mock <ICommandUtil> commandUtil, NormalCommand normalCommand, int?count = null, RegisterName registerName = null)
        {
            var realCount   = FSharpOption.CreateForNullable(count);
            var realName    = FSharpOption.CreateForReference(registerName);
            var commandData = new CommandData(realCount, realName);
            var command     = Command.NewNormalCommand(normalCommand, commandData);

            commandUtil
            .Setup(x => x.RunCommand(command))
            .Returns(CommandResult.NewCompleted(ModeSwitch.NoSwitch))
            .Verifiable();
        }
Beispiel #58
0
 public PushInstruction(RegisterName registerName)
 {
     this.RegisterName = registerName;
 }
Beispiel #59
0
        public static void SetupCommandVisual(this Mock <ICommandUtil> commandUtil, VisualCommand visualCommand, int?count = null, RegisterName registerName = null, VisualSpan visualSpan = null)
        {
            var realCount = count.HasValue ? FSharpOption.Create(count.Value) : FSharpOption <int> .None;
            var realName  = registerName != null?FSharpOption.Create(registerName) : FSharpOption <RegisterName> .None;

            var commandData = new CommandData(realCount, realName);

            if (visualSpan != null)
            {
                var command = Command.NewVisualCommand(visualCommand, commandData, visualSpan);
                commandUtil
                .Setup(x => x.RunCommand(command))
                .Returns(CommandResult.NewCompleted(ModeSwitch.SwitchPreviousMode))
                .Verifiable();
            }
            else
            {
                commandUtil
                .Setup(x => x.RunCommand(It.Is <Command>(command =>
                                                         command.IsVisualCommand &&
                                                         command.AsVisualCommand().Item1.Equals(visualCommand) &&
                                                         command.AsVisualCommand().Item2.Equals(commandData))))
                .Returns(CommandResult.NewCompleted(ModeSwitch.SwitchPreviousMode))
                .Verifiable();
            }
        }
Beispiel #60
0
 public MvIm(uint toLoad, RegisterName destination)
 {
     this.toLoad = toLoad;
     this.destination = destination;
 }