コード例 #1
0
        public WindowsForm2()
        {
            InitializeComponent();
            List <MainWindows.MainWindowsDelegate> clients = new List <MainWindows.MainWindowsDelegate>(2);

            MainWindows.MainWindowsDelegate x  = new MainWindows.MainWindowsDelegate(populateTextBox);
            MainWindows.MainWindowsDelegate xx = new MainWindows.MainWindowsDelegate(populateGridbox);
            clients.Add(x);
            clients.Add(xx);
            mw = new MainWindows(refreshMillis, clients, new RealWindowStuff());
        }
コード例 #2
0
    public WindowsForm()
    {
        InitializeComponent();
        MainWindows.MainWindowsDelegate        x  = new MainWindows.MainWindowsDelegate(populateWindowsGridListView);
        List <MainWindows.MainWindowsDelegate> lc = new List <MainWindows.MainWindowsDelegate>(1);

        lc.Add(x);
        RealWindowStuff ws = new RealWindowStuff();

        mw = new MainWindows(refreshMillis, lc, ws);
    }
コード例 #3
0
      public void MainWindowsTest()
      {
          QuasiLogger.log("MainWindowsTest()");
          MainWindows.MainWindowsDelegate        x       = new MainWindows.MainWindowsDelegate(blah);
          List <MainWindows.MainWindowsDelegate> clients = new List <MainWindows.MainWindowsDelegate>(1);

          clients.Add(x);
          int i = 1000;
          List <FakeWindowStuff.FakedWindow> fws = new List <FakeWindowStuff.FakedWindow>();

          fws.Add(new FakeWindowStuff.FakedWindow(new IntPtr(i++), "TestWindow_1", false));     //1000
          fws.Add(new FakeWindowStuff.FakedWindow(new IntPtr(i++), "TestWindow_2", true));
          fws.Add(new FakeWindowStuff.FakedWindow(new IntPtr(i++), "TestWindow_3", false));
          fws.Add(new FakeWindowStuff.FakedWindow(new IntPtr(i++), "TestWindow_4", true));
          fws.Add(new FakeWindowStuff.FakedWindow(new IntPtr(i++), "TestWindow_5", false));
          fws.Add(new FakeWindowStuff.FakedWindow(new IntPtr(i++), "TestWindow_6", true));
          fws.Add(new FakeWindowStuff.FakedWindow(new IntPtr(i++), "TestWindow_7", false));
          fws.Add(new FakeWindowStuff.FakedWindow(new IntPtr(i++), "TestWindow_8", true));

          //SetTimer for ending the test;
          QuasiLogger.log("SetTimer()");
          aTimer           = new System.Timers.Timer(_timeoutForTest);
          aTimer.Elapsed  += OnTimedEvent;
          aTimer.AutoReset = true;
          aTimer.Enabled   = true;

          //set windows first time
          _mw = new MainWindows(Convert.ToInt32(cycle), clients, new FakeWindowStuff(fws));

          //a timer after n seconds which alters after a pause the window list ... = user did something.
          QuasiLogger.log("setting usertimer to: " + _timequasiUserTimer + " mytime: " + myTime());
          quasiUserTimer           = new System.Timers.Timer(_timequasiUserTimer);
          quasiUserTimer.Elapsed  += OnquasiUserTimer;
          quasiUserTimer.AutoReset = true;
          quasiUserTimer.Enabled   = true;

          //test leider beendet...
          while (!_finished && !_hasException)
          {
          }
          if (_hasException)
          {
              Assert.Fail("An exception occured.");
          }
          if (_calls != 4)
          {
              Assert.Fail("Not all tests done.");
          }
      }