Exemplo n.º 1
0
        public SubmissionTester(StudentSubmission submission)
        {
            _submission = submission;
            _assignment = submission.StudentAssignment.Assignment;

            _repo = SubmissionRepository.Get(submission.StudentAssignment);
            _repo.Checkout(submission.CommitId);

            _validator = new W3CValidator(_repo.FileUri);

            var allDeviceIds = _assignment.AllScripts.Select(s => s.DeviceId).Distinct();

            foreach (var deviceId in allDeviceIds)
            {
                _allDevices.Add(Device.Parse(deviceId));
            }
            if (_allDevices.Count == 0)
            {
                _allDevices.Add(Device.Large);
            }

            _browser = BrowserFactory.GetDriver();
            if (_browser != null)
            {
                _browser.SetWindowSize(Device.Large.ViewportWidth, Device.Large.ViewportHeight);
            }
        }
Exemplo n.º 2
0
        private bool disposedValue = false; // To detect redundant calls

        protected virtual void Dispose(bool disposing)
        {
            if (!disposedValue)
            {
                if (disposing)
                {
                    _browser.Dispose();
                }

                _presubmissionResults = null;
                _fullResults          = null;
                _submission           = null;
                _assignment           = null;
                _repo       = null;
                _validator  = null;
                _allDevices = null;
                _browser    = null;

                disposedValue = true;
            }
        }