public void DAO_FindAll() { int numberTags = 5; List <Tag> createdTags = new List <Tag>(numberTags); for (int i = 0; i < numberTags; i++) { tag = new Tag { tagName = TagName + i }; tagDao.Create(tag); createdTags.Add(tag); } List <Tag> totalRetrievedTags = tagDao.FindAll(); Assert.AreEqual(numberTags, totalRetrievedTags.Count); for (int i = 0; i < numberTags; i++) { Assert.AreEqual(totalRetrievedTags[i], createdTags[i]); } }
public void MyTestInitialize() { transaction = new TransactionScope(); category = new Category(); category.categoryName = categoryName; category2 = new Category(); category2.categoryName = "Category2"; categoryDao.Create(category); categoryDao.Create(category2); tag = new Tag(); tag.tagName = "tag"; tagDao.Create(tag); user = new UserProfile(); user.address = "address"; user.country = "ES"; user.language = "es"; user.loginName = "login"; user.enPassword = "******"; user.firstName = "name"; user.lastName = "surname"; user.role = 0; user.email = "email"; userProfileDao.Create(user); }
private static long CreateTag(string tagName, int n) { Tag tag = new Tag(); tag.timesUsed = n; tag.name = tagName; tagDao.Create(tag); return(tag.tagId); }
public void Create(UserInfo userInfo, TagInfo tagInfo) { var displayName = FormatDisplayName(tagInfo.DisplayName); var tag = _tagDao.GetByName(displayName); if (tag == null) { tag = _converter.ToDomainObject(tagInfo); _tagDao.Create(tag); } }
private Tag CreateTag(string tagName) { Tag tag = new Tag { tagName = tagName }; tagDao.Create(tag); return(tag); }
private Tag CreateTag(string tagDisplayName) { Tag newTag = new Tag(); newTag.DisplayName = tagDisplayName.ToLower().Trim(); newTag.UsedCount = 1; newTag.LastUsedDatetime = DateTime.UtcNow; try { _tagDao.Create(newTag); } catch { AddTagUsedCount(newTag); } return(newTag); }