示例#1
0
        /// <summary>
        /// Configures current test session with the given options
        /// </summary>
        /// <param name="options">Defines options for current test session</param>
        public void ConfigureStartup(TestOptions options)
        {
            if (IsTestInProgress)
            {
                return;
            }

            if (CurrentSessionIdentifier.Equals(default(Guid)))
            {
                CurrentSessionIdentifier = Guid.NewGuid();
            }

            // If there were no args before create new ones
            if (TestStartupArgs == null)
            {
                TestStartupArgs = new TestStartupArgs()
                {
                    SessionIdentifier    = CurrentSessionIdentifier,
                    FullScreenMode       = options.FullScreenEnabled,
                    IsResultsPageAllowed = options.ResultsPageAllowed,
                    TimerOffset          = TimeSpan.FromSeconds(0),
                };
            }
            // Or update existing ones
            else
            {
                TestStartupArgs.FullScreenMode       = options.FullScreenEnabled;
                TestStartupArgs.IsResultsPageAllowed = options.ResultsPageAllowed;
            }
        }
示例#2
0
 /// <summary>
 /// Sets the test startup arguments send by the server
 /// </summary>
 /// <param name="args">The arguments to be set</param>
 public void SetupArguments(TestStartupArgs args)
 {
     AreResultsAllowed   = args.IsResultsPageAllowed;
     IsFullScreenEnabled = args.FullScreenMode;
     TimeLeft            = CurrentTest.Info.Duration - args.TimerOffset;
 }