public void TestAddDirectoryExisting()
        {
            DirectoryData dd = new DirectoryData("id", _directoryName);
            _directoryQuery.Insert(dd);

            Assert.IsTrue(new DirectoryInfo(Path.Combine(_workDirectory, _directoryName)).Exists);
        }
        public void TestDeleteDirectory()
        {
            DirectoryData dd = new DirectoryData("id", _directoryName);
            _directoryQuery.Delete(dd);

            Assert.IsFalse(new DirectoryInfo(Path.Combine(_workDirectory, _directoryName)).Exists);
        }
        public void TestDeleteDirectoryNotExisting()
        {
            string notExistingDirectoryName = "NotExistingDirectory";
            DirectoryData dd = new DirectoryData("id", notExistingDirectoryName);
            _directoryQuery.Delete(dd);

            Assert.IsFalse(new DirectoryInfo(Path.Combine(_workDirectory, notExistingDirectoryName)).Exists);
        }
        public void Insert(Widget entity)
        {
            DirectoryData directoryData = new DirectoryData(entity.Id, entity.Name);

            _directoryQuery.Insert(directoryData);

            _fileQuery = new FileQuery(directoryData.Id);
            foreach (WidgetData widgetData in entity.Data)
            {
                FileData fileData = new FileData(widgetData.Id, widgetData.Name, Convert.ToString(widgetData.Data));
                _fileQuery.Insert(fileData);
            }
        }