/// <summary> /// Initializes a new instance of the TestSuiteHelper class. /// </summary> /// <param name="testSite">The instance of ITestSite.</param> /// <param name="listName">The name of list in the site.</param> /// <param name="fileName">The name of file in the list.</param> /// <param name="listsSutControlAdapter">The instance of ILISTSWSSUTControlAdapter interface.</param> /// <param name="protocolAdapter">The instance of the protocol adapter.</param> /// <param name="sutControlAdapter">The instance of the SUT control adapter.</param> public TestSuiteHelper( ITestSite testSite, string listName, string fileName, IMS_LISTSWSSUTControlAdapter listsSutControlAdapter, IMS_VERSSAdapter protocolAdapter, IMS_VERSSSUTControlAdapter sutControlAdapter) { this.site = testSite; this.listsSutControlAdaterInstance = listsSutControlAdapter; this.sutControlAdapterInstance = sutControlAdapter; this.protocolAdapterInstance = protocolAdapter; this.requestUrl = Common.GetConfigurationPropertyValue("RequestUrl", testSite); this.documentLibrary = listName; this.fileName = fileName; this.listId = listsSutControlAdapter.GetListID(listName); this.fileVersionAttributes.Clear(); }
public void TestCaseInitialize() { this.sutControlAdapterInstance = this.Site.GetAdapter <IMS_VERSSSUTControlAdapter>(); this.protocolAdapterInstance = this.Site.GetAdapter <IMS_VERSSAdapter>(); Common.CheckCommonProperties(this.Site, true); this.listsSutControlAdaterInstance = this.Site.GetAdapter <IMS_LISTSWSSUTControlAdapter>(); #region Initialize the variables string datetimestamp = Common.FormatCurrentDateTime(); this.requestUrl = Common.GetConfigurationPropertyValue("RequestUrl", this.Site); this.documentLibrary = Common.GetConfigurationPropertyValue("DocumentLibraryName", this.Site) + "_" + datetimestamp; string fileNameValue = Common.GetConfigurationPropertyValue("FileName", this.Site); this.fileName = System.IO.Path.GetFileNameWithoutExtension(fileNameValue) + "_" + datetimestamp + System.IO.Path.GetExtension(fileNameValue); this.fileRelativeUrl = this.documentLibrary + "/" + this.fileName; Uri requestUri = new Uri(this.requestUrl); this.fileAbsoluteUrl = AdapterHelper.ConstructDocFileFullUrl(requestUri, this.documentLibrary, this.fileName); #endregion #region Initialize the server bool isAddList = this.listsSutControlAdaterInstance.AddList(this.documentLibrary); Site.Assume.IsTrue( isAddList, "AddList operation returns {0}, TRUE means the operation was executed successfully," + " FALSE means the operation failed", isAddList); #endregion this.testSuiteHelper = new TestSuiteHelper( this.Site, this.documentLibrary, this.fileName, this.listsSutControlAdaterInstance, this.protocolAdapterInstance, this.sutControlAdapterInstance); }
public void TestCaseInitialize() { this.sutControlAdapterInstance = this.Site.GetAdapter<IMS_VERSSSUTControlAdapter>(); this.protocolAdapterInstance = this.Site.GetAdapter<IMS_VERSSAdapter>(); Common.CheckCommonProperties(this.Site, true); this.listsSutControlAdaterInstance = this.Site.GetAdapter<IMS_LISTSWSSUTControlAdapter>(); #region Initialize the variables string datetimestamp = Common.FormatCurrentDateTime(); this.documentLibrary = Common.GetConfigurationPropertyValue("DocumentLibraryName", this.Site) + "_" + datetimestamp; string fileNameValue = Common.GetConfigurationPropertyValue("FileName", this.Site); this.fileName = System.IO.Path.GetFileNameWithoutExtension(fileNameValue) + "_" + datetimestamp + System.IO.Path.GetExtension(fileNameValue); this.fileRelativeUrl = this.documentLibrary + "/" + this.fileName; #endregion #region Initialize the server bool isAddList = this.listsSutControlAdaterInstance.AddList(this.documentLibrary); Site.Assert.IsTrue( isAddList, "AddList operation returns {0}, TRUE means the operation was executed successfully," + " FALSE means the operation failed", isAddList); #endregion this.testSuiteHelper = new TestSuiteHelper( this.Site, this.documentLibrary, this.fileName, this.listsSutControlAdaterInstance, this.protocolAdapterInstance, this.sutControlAdapterInstance); }