public async Task InterpretDataAsync() { Adc expected = new Adc(418, 123, 154, 124); Adc actual = null; await color.Adc.AddRouteAsync(source => source.Stream(data => actual = data.Value <Adc>())); platform.sendMockResponse(new byte[] { 0x17, 0x81, 0xa2, 0x01, 0x7b, 0x00, 0x9a, 0x00, 0x7c, 0x00 }); Assert.That(actual, Is.EqualTo(expected)); }
public void Adc_regmem8_imm8() { var instrString = "adc BYTE [1234], 123"; var instruction = new Adc( new EffectiveAddress(DataSize.Bit8, DataSize.None, c => new SimpleExpression(1234)), new Immediate(123)); AssertInstruction(instruction, instrString, DataSize.Bit16); AssertInstruction(instruction, instrString, DataSize.Bit32); AssertInstruction(instruction, instrString, DataSize.Bit64); }
public void Adc_reg8_regmem8() { var instrString = "adc CL, BYTE [1234]"; var instruction = new Adc( new RegisterOperand(Register.CL), new EffectiveAddress(DataSize.Bit8, DataSize.None, c => new SimpleExpression(1234))); AssertInstruction(instruction, instrString, DataSize.Bit16); AssertInstruction(instruction, instrString, DataSize.Bit32); AssertInstruction(instruction, instrString, DataSize.Bit64); }
public void Adc_regmem64_reg64() { var instrString = "adc QWORD [1234], RCX"; var instruction = new Adc( new EffectiveAddress(DataSize.Bit64, DataSize.None, c => new SimpleExpression(1234)), new RegisterOperand(Register.RCX)); Assert16BitInstructionFails(instruction); Assert32BitInstructionFails(instruction); AssertInstruction(instruction, instrString, DataSize.Bit64); }
public void Adc_regmem16_reg16() { var instrString = "adc WORD [1234], CX"; var instruction = new Adc( new EffectiveAddress(DataSize.Bit16, DataSize.None, c => new SimpleExpression(1234)), new RegisterOperand(Register.CX)); AssertInstruction(instruction, instrString, DataSize.Bit16); AssertInstruction(instruction, instrString, DataSize.Bit32); AssertInstruction(instruction, instrString, DataSize.Bit64); }
public void Adc_regmem64_imm8() { var instrString = "adc QWORD [1234], 123"; var instruction = new Adc( new EffectiveAddress(DataSize.Bit64, DataSize.None, c => new SimpleExpression(1234)), new Immediate(123)); Assert16BitInstructionFails(instruction); Assert32BitInstructionFails(instruction); AssertInstruction(instruction, instrString, DataSize.Bit64); }
public void Adc_regmem64_imm32() { var instruction = new Adc( new EffectiveAddress(DataSize.Bit64, DataSize.None, c => new SimpleExpression(1234)), new Immediate(12345, DataSize.Bit32)); Assert16BitInstructionFails(instruction); Assert32BitInstructionFails(instruction); Assert64BitInstruction(instruction, new byte[] { 0x48, 0x81, 0x14, 0x25, 0xD2, 0x04, 0x00, 0x00, 0x39, 0x30, 0x00, 0x00 }); }
public void Adc_regmem16_imm16() { var instrString = "adc WORD [1234], WORD 12345"; var instruction = new Adc( new EffectiveAddress(DataSize.Bit16, DataSize.None, c => new SimpleExpression(1234)), new Immediate(12345, DataSize.Bit16)); AssertInstruction(instruction, instrString, DataSize.Bit16); AssertInstruction(instruction, instrString, DataSize.Bit32); AssertInstruction(instruction, instrString, DataSize.Bit64); }
public void Adc_reg64_regmem64() { var instruction = new Adc( new RegisterOperand(Register.RCX), new EffectiveAddress(DataSize.Bit64, DataSize.None, c => new SimpleExpression(1234))); Assert16BitInstructionFails(instruction); Assert32BitInstructionFails(instruction); Assert64BitInstruction(instruction, new byte[] { 0x48, 0x13, 0x0C, 0x25, 0xD2, 0x04, 0x00, 0x00 }); }
public void Adc_reg32_regmem32() { var instrString = "adc ECX, DWORD [1234]"; var instruction = new Adc( new RegisterOperand(Register.ECX), new EffectiveAddress(DataSize.Bit32, DataSize.None, c => new SimpleExpression(1234))); AssertInstruction(instruction, instrString, DataSize.Bit16); AssertInstruction(instruction, instrString, DataSize.Bit32); AssertInstruction(instruction, instrString, DataSize.Bit64); }
public void Adc_RAX_imm32() { var instruction = new Adc( new RegisterOperand(Register.RAX), new Immediate(1234567890)); Assert16BitInstructionFails(instruction); Assert32BitInstructionFails(instruction); Assert64BitInstruction(instruction, new byte[] { 0x48, 0x15, 0xD2, 0x02, 0x96, 0x49 }); }
public void Adc_EAX_imm32() { var instrString = "adc EAX, 1234567890"; var instruction = new Adc( new RegisterOperand(Register.EAX), new Immediate(1234567890)); AssertInstruction(instruction, instrString, DataSize.Bit16); AssertInstruction(instruction, instrString, DataSize.Bit32); AssertInstruction(instruction, instrString, DataSize.Bit64); }
public void Adc_AX_imm16() { var instrString = "adc AX, 12345"; var instruction = new Adc( new RegisterOperand(Register.AX), new Immediate(12345)); AssertInstruction(instruction, instrString, DataSize.Bit16); AssertInstruction(instruction, instrString, DataSize.Bit32); AssertInstruction(instruction, instrString, DataSize.Bit64); }
public void Adc_AL_imm8() { var instruction = new Adc( new RegisterOperand(Register.AL), new Immediate(123)); Assert16BitInstruction(instruction, new byte[] { 0x14, 0x7B }); Assert32BitInstruction(instruction, new byte[] { 0x14, 0x7B }); Assert64BitInstruction(instruction, new byte[] { 0x14, 0x7B }); }
public override bool Equals(Object obj) { if (this == obj) { return(true); } if (obj == null || GetType() != obj.GetType()) { return(false); } Adc adc = obj as Adc; return(Clear == adc.Clear && Red == adc.Red && Green == adc.Green && Blue == adc.Blue); }
public bool Has(string champ) => Mid.Has(champ) || Top.Has(champ) || Jun.Has(champ) || Adc.Has(champ) || Sup.Has(champ);
public static void SelectChampions(Champion champion) { int cNumber = 0; bool check = true; var items = GetItems(); switch (champion.Type) { case TypeEnum.Adc: Adc adc = new Adc(); adc.Name = champion.Name; adc.Type = TypeEnum.Adc; do { foreach (var item in items) { Console.WriteLine("{0}-{1}", item.Id, item.Name); } Console.WriteLine("Lütfen Şampiyon Ekipmanlarını Seçiniz!"); do { Tuple <bool, int> adcCheck = CheckNumber(1, 9); check = adcCheck.Item1; cNumber = adcCheck.Item2; } while (check); check = true; var selectedItem = items.FirstOrDefault(x => x.Id == cNumber); if (selectedItem == null) { Environment.Exit(0); } adc.AddItem(selectedItem); Console.WriteLine("Şampiyon Ekipmanı seçimine devam edilsin mi! Y:Evet N:Hayır"); string result = string.Empty; do { result = Console.ReadLine(); if (result != "N" && result != "Y") { Console.WriteLine("Yanlış seçim yaptınız!Şampiyon Ekipmanı seçimine devam edilsin mi! Y:Evet N:Hayır"); } else { check = false; } } while (check); check = true; if (result == "N") { if (adc.CheckItem()) { check = false; adc.WriteProperties(); } else { Console.WriteLine("Şampiyon Ekipmanı tamamlanmamıştır ekipman eklemeye devam ediniz."); } } }while (check); break; case TypeEnum.Support: Support support = new Support(); support.Name = champion.Name; support.Type = TypeEnum.Support; do { foreach (var item in items) { Console.WriteLine("{0}-{1}", item.Id, item.Name); } Console.WriteLine("Lütfen Şampiyon Ekipmanlarını Seçiniz!"); do { Tuple <bool, int> supCheck = CheckNumber(1, 9); check = supCheck.Item1; cNumber = supCheck.Item2; } while (check); check = true; var selectedItem = items.FirstOrDefault(x => x.Id == cNumber); if (selectedItem == null) { Environment.Exit(0); } support.AddItem(selectedItem); Console.WriteLine("Şampiyon Ekipmanı seçimine devam edilsin mi! Y:Evet N:Hayır"); string result = string.Empty; do { result = Console.ReadLine(); if (result != "N" && result != "Y") { Console.WriteLine("Yanlış seçim yaptınız!Şampiyon Ekipmanı seçimine devam edilsin mi! Y:Evet N:Hayır"); } else { check = false; } } while (check); check = true; if (result == "N") { if (support.CheckItem()) { check = false; support.WriteProperties(); } else { Console.WriteLine("Şampiyon Ekipmanı tamamlanmamıştır ekipman eklemeye devam ediniz."); } } }while (check); break; case TypeEnum.Magician: Magician magician = new Magician(); magician.Name = champion.Name; magician.Type = TypeEnum.Magician; do { foreach (var item in items) { Console.WriteLine("{0}-{1}", item.Id, item.Name); } Console.WriteLine("Lütfen Şampiyon Ekipmanlarını Seçiniz!"); do { Tuple <bool, int> magCheck = CheckNumber(1, 9); check = magCheck.Item1; cNumber = magCheck.Item2; } while (check); check = true; var selectedItem = items.FirstOrDefault(x => x.Id == cNumber); if (selectedItem == null) { Environment.Exit(0); } magician.AddItem(selectedItem); Console.WriteLine("Şampiyon Ekipmanı seçimine devam edilsin mi! Y:Evet N:Hayır"); string result = string.Empty; do { result = Console.ReadLine(); if (result != "N" && result != "Y") { Console.WriteLine("Yanlış seçim yaptınız!Şampiyon Ekipmanı seçimine devam edilsin mi! Y:Evet N:Hayır"); } else { check = false; } } while (check); check = true; if (result == "N") { if (magician.CheckItem()) { check = false; magician.WriteProperties(); } else { Console.WriteLine("Şampiyon Ekipmanı tamamlanmamıştır ekipman eklemeye devam ediniz."); } } }while (check); break; } }