public void TestAddIcon() { CIcon icon = new CIcon() { ImageUri = "dummy.png", Name = "dummy" }; CIcon newIcon = _repo.AddIcon(icon); Assert.AreEqual(icon.ImageUri, newIcon.ImageUri); Assert.AreEqual(icon.Name, newIcon.Name); }
public void TestGetIcon() { int cnt = _repo.GetAllIcons().Count; CIcon icon = new CIcon() { ImageUri = "dummy.png", Name = "dummy" }; _repo.AddIcon(icon); Assert.AreEqual(cnt + 1, _repo.GetAllIcons().Count); }
private void CreateIcons() { DirectoryInfo dirInfo = new DirectoryInfo(ICON_FILES_PATH); FileInfo[] files = dirInfo.GetFiles(); foreach (FileInfo fInfo in files) { string path = fInfo.Name; string name = fInfo.Name.Replace(".png", ""); CIcon icon = new CIcon() { ImageUri = path, Name = name }; _repo.AddIcon(icon); } }
public void TestClearAllIcons() { _repo.ClearAllIcons(); Assert.IsTrue(_repo.GetAllIcons().Count == 0); //test sequence CIcon icon = new CIcon() { ImageUri = "dummy.png", Name = "dummy" }; CIcon newIcon = _repo.AddIcon(icon); Assert.IsTrue(newIcon.Id == 1); }