Esempio n. 1
0
 public void CollectionTest()
 {
     InsertTest();
     DBDictionary dbDictionary = new DBDictionary();
     dbDictionary.Connection = GetConnection();
     DictionaryEntry entry = new DictionaryEntry();
     entry.Active = true;
     entry.Guid = "69E68ADF-A083-4889-BC11-8353B8CA5EAD";
     entry.Name = "Test";
     entry.Type = MWRCommonTypes.Enum.ObjectType.State;
     dbDictionary.Save(entry);
     DBDictionaryCollection collection = new DBDictionaryCollection(new SqlDataProvider());
     collection.Connection = GetConnection();
     collection.Load();
     Assert.IsTrue(collection.List.Count == 2);
     dbDictionary.Delete();
     dbDictionary.Delete("AEF29AAA-0F23-4ba3-AA10-BAE05B3E4503");
 }
Esempio n. 2
0
        public void GetDirectoryTest()
        {
            MWRCommonTypes.Tasks.FileManageTask ft = new MWRCommonTypes.Tasks.FileManageTask();
            ft.CurrentOperation = MWRCommonTypes.Tasks.OperationType.GetDirectory;
            ft.RequestedObjectPath = "E:\\Konfiguracja";
            FillData(ft);
            TaskStruct ts = ft.ToTaskStruct();

            DictionaryEntry entry = new DictionaryEntry();
            entry.Active = true;
            entry.Config = "<config><MaxSubLevel>5</MaxSubLevel><MaxFileSize>100000</MaxFileSize></config>";
            entry.Guid = MWRCommonTypes.Tasks.FileManageTask.UniqueID;
            entry.Type = MWRCommonTypes.Enum.ObjectType.Task;
            entry.TypeOf = "MWRCommonTypes.Tasks.FileManageTask";

            MWRCommonTypes.Tasks.FileManageTask ftNew = new MWRCommonTypes.Tasks.FileManageTask();
            ftNew.Init(ts);
            ftNew.LoadConfig(entry.Config);

            ProcessResult pr = ftNew.Process();

            TaskStruct toUpdate = ftNew.ToTaskStruct();
            Task toClient = new MWRCommonTypes.Tasks.FileManageTask();
            toClient.Init(toUpdate);
        }
Esempio n. 3
0
 public void InsertTest()
 {
     DBDictionary dbDictionary = new DBDictionary();
     dbDictionary.Connection = GetConnection();
     DictionaryEntry entry = new DictionaryEntry();
     entry.Active = true;
     entry.Guid = "AEF29AAA-0F23-4ba3-AA10-BAE05B3E4503";
     entry.Name = "Test";
     entry.Type = MWRCommonTypes.Enum.ObjectType.State;
     Assert.IsTrue(dbDictionary.Save(entry));
 }