Exemplo n.º 1
0
        public void SampleTestMethod()
        {
            KBActionRecorderLinq recorder = new KBActionRecorderLinq();
            recorder.SaveRecordedFileAs("SaveAsFile");

            Assert.AreEqual<bool>(File.Exists("SaveAsFile"), true);

            File.Delete("SaveAsFile");
        }
Exemplo n.º 2
0
        public override void StartPlaybackWithExistingFile(string filePath)
        {
            KBActionRecorderLinq tmpKbActionRecorder = new KBActionRecorderLinq(filePath);

            Win32API.KeyEvent[] actions = tmpKbActionRecorder.GetDatas();

            Thread.Sleep(1000);

            foreach (var item in actions)
            {
                kbSimulator.Simulate(item.bVk, 0, item.dwFlags, 0);
                Thread.Sleep(item.delayTime);
            }
        }
Exemplo n.º 3
0
 public void KBActionRecorderLinqConstructorTest()
 {
     string actionsListFileName = "actionsListFileName"; // TODO: Initialize to an appropriate value
     KBActionRecorderLinq target = new KBActionRecorderLinq(actionsListFileName);
     Assert.IsNotNull(target);
 }
Exemplo n.º 4
0
 public void WriteDataTest()
 {
     KBActionRecorderLinq target = new KBActionRecorderLinq(); 
     string keyEvents = KeyboardEvents.WM_KeyDown.ToString(); 
     Keys myKey = Keys.A;
     int delayTime = 10; 
     target.WriteData(keyEvents, myKey, delayTime);
     target.SaveActions();
     Win32API.KeyEvent Expected = new Win32API.KeyEvent()
     {
         dwFlags = Miku.Client.Win32API_Accessor.KBEventFlag.KeyDown,
         bVk = Convert.ToInt32(Keys.A),
         delayTime = 10
     };
     var actual = target.GetDatas()[0];
     
     Assert.AreEqual(Expected,actual);
     
    
     
 }
Exemplo n.º 5
0
 public void GetDatasTest()
 {
     KBActionRecorderLinq target = new KBActionRecorderLinq();
     target.WriteData(KeyboardEvents.WM_KeyDown.ToString(), Keys.A, 10);
     target.SaveActions();
     Win32API.KeyEvent[] expected = new Win32API.KeyEvent[]
     {
         new Win32API.KeyEvent()
         {
             dwFlags = Miku.Client.Win32API_Accessor.KBEventFlag.KeyDown,
             bVk = Convert.ToInt32(Keys.A),
             delayTime = 10
         }
     }; 
     Win32API.KeyEvent[] actual;
     actual = target.GetDatas();
     Assert.AreEqual(expected[0], actual[0]);
     
 }
Exemplo n.º 6
0
 public KBActionStrategy(IntPtr hookedInstance)
 {
     kbHook = new KBDLLHook(hookedInstance);
     kbActionRecorder = new KBActionRecorderLinq();
     kbSimulator = new KeyboardSimulator();
 }