Ejemplo n.º 1
0
        internal static string GetContextId(Excel.Workbook workbook)
        {
            if (null == workbook)
            {
                throw new ArgumentNullException("workbook");
            }

            return(ExcelWorkbookCustomPropertyAccessor.Get(workbook, ID_PROPERTY) ?? string.Empty);
        }
Ejemplo n.º 2
0
        public WorkbookContext(Excel.Workbook workbook)
        {
            if (null == workbook)
            {
                throw new ArgumentNullException("workbook");
            }

            this.Workbook = workbook;
            this.Id       = GetContextId(workbook);

            if (string.IsNullOrWhiteSpace(this.Id))
            {
                this.Id = Guid.NewGuid().ToString();
                ExcelWorkbookCustomPropertyAccessor.Set(workbook, ID_PROPERTY, this.Id);
            }

            this.TestCases = new TestCaseCollection();
            this.settings  = WorkbookContextSettings.Load(this.Workbook);
            this.Update();
        }