/// <summary>
        /// Record the user name, folder collectionId and subjects the current test case impacts.
        /// </summary>
        /// <param name="userName">The user that current test case used.</param>
        /// <param name="folderCollectionId">The collectionId of folders that the current test case impact.</param>
        /// <param name="itemSubjects">The subject of items that the current test case impact.</param>
        protected void RecordCaseRelativeItems(string userName, string folderCollectionId, params string[] itemSubjects)
        {
            // Record the item in the specified folder.
            CreatedItems createdItems = new CreatedItems { CollectionId = folderCollectionId };

            foreach (string subject in itemSubjects)
            {
                createdItems.ItemSubject.Add(subject);
            }

            // Record the created items of User1.
            if (userName == this.User1Information.UserName)
            {
                this.User1Information.UserCreatedItems.Add(createdItems);
            }

            // Record the created items of User2.
            if (userName == this.User2Information.UserName)
            {
                this.User2Information.UserCreatedItems.Add(createdItems);
            }
        }
Пример #2
0
        /// <summary>
        /// Record items impacted by current test case.
        /// </summary>
        /// <param name="collectionId">The CollectionId of the folder which the item is placed.</param>
        /// <param name="itemSubject">The subject of the item to delete.</param>
        /// <returns>The items impacted by current test case.</returns>
        public static CreatedItems RecordCreatedItem(string collectionId, string itemSubject)
        {
            CreatedItems createdItems = new CreatedItems { CollectionId = collectionId };
            createdItems.ItemSubject.Add(itemSubject);

            return createdItems;
        }
Пример #3
0
        /// <summary>
        /// Add the created item in test cases to the items collections used to clean up.
        /// </summary>
        /// <param name="userName">The identity of the user who has the item.</param>
        /// <param name="parentFolder">The CollectionId of the folder which the item is placed.</param>
        /// <param name="itemSubject">The subject of the item to delete.</param>
        protected void AddCreatedItemToCollection(string userName, string parentFolder, string itemSubject)
        {
            CreatedItems createdItems = new CreatedItems { CollectionId = parentFolder };
            createdItems.ItemSubject.Add(itemSubject);

            // Add the created items to the specified user item collection.
            switch (userName)
            {
                case "User1":
                    this.UserOneInformation.UserCreatedItems.Add(createdItems);
                    break;
                case "User2":
                    this.UserTwoInformation.UserCreatedItems.Add(createdItems);
                    break;
                case "User3":
                    this.UserThreeInformation.UserCreatedItems.Add(createdItems);
                    break;
                default:
                    Site.Assert.Fail("The user name is incorrect.");
                    break;
            }
        }
 /// <summary>
 /// Add the item created in test case to the item collections needed to clean up.
 /// </summary>
 /// <param name="userInformation">The identity of the user who has the item.</param>
 /// <param name="parentFolder">The CollectionId of the folder in which the item is placed.</param>
 /// <param name="itemSubject">The subject of the item to delete.</param>
 protected static void AddCreatedItemToCollection(UserInformation userInformation, string parentFolder, string itemSubject)
 {
     CreatedItems createdItems = new CreatedItems { CollectionId = parentFolder };
     createdItems.ItemSubject.Add(itemSubject);
     userInformation.UserCreatedItems.Add(createdItems);
 }
Пример #5
0
        /// <summary>
        /// Record the user name, folder collectionId and subjects the current test case impacts.
        /// </summary>
        /// <param name="userInformation">The user that current test case used.</param>
        /// <param name="folderCollectionId">The collectionId of folders that the current test case impact.</param>
        /// <param name="itemSubjects">The subject of items that the current test case impact.</param>
        protected static void RecordCaseRelativeItems(UserInformation userInformation, string folderCollectionId, params string[] itemSubjects)
        {
            CreatedItems createdItems = new CreatedItems { CollectionId = folderCollectionId };
            foreach (string itemSubject in itemSubjects)
            {
                createdItems.ItemSubject.Add(itemSubject);
            }

            userInformation.UserCreatedItems.Add(createdItems);
        }