void Check(IActionWorker worker, bool serverMode, bool clientMode)
        {
            CustomActionData customActionData = new CustomActionData();
              Microsoft.Deployment.WindowsInstaller.Fakes.ShimSession.AllInstances.CustomActionDataGet = delegate { return customActionData; };

              // Проверка режима сервера.
              SetValue(worker, false);
              customActionData.AddObject<UIType>(SessionUITypeGetterExtension.keyUIType, UIType.Server);
              worker.Execute();
              Assert.AreEqual(serverMode, GetValue(worker), worker.GetType().ToString() + " Server");

              // Проверка режима клиента.
              SetValue(worker, false);
              customActionData.Clear();
              customActionData.AddObject<UIType>(SessionUITypeGetterExtension.keyUIType, UIType.Client);
              worker.Execute();
              Assert.AreEqual(clientMode, GetValue(worker), worker.GetType().ToString() + " Client");
        }