コード例 #1
0
        public void TestDeviceExtractionProperties()
        {
            CaseInfo ci = new CaseInfo();

            ci.Name   = "hj";
            ci.Number = "123";
            ci.Type   = "1";
            ci.Author = "hj";
            ci.Path   = @"G:\XLY\SpfData";
            Case             @case = Case.New(ci);
            DeviceExtraction de    = @case.CreateDeviceExtraction("设备1", "andrion");

            Assert.IsNotNull(de);
            de["SN"] = "1234565";
            Assert.IsTrue(de.Save());
        }
コード例 #2
0
        public void TestDeviceExtractionExtractItem()
        {
            CaseInfo ci = new CaseInfo();

            ci.Name   = "hj";
            ci.Number = "123";
            ci.Type   = "1";
            ci.Author = "hj";
            ci.Path   = @"G:\XLY\SpfData";
            Case @case = Case.New(ci);

            //相对路径
            DeviceExtraction de = @case.CreateDeviceExtraction("设备1", "andrion相对路径");

            de["Name"]  = "hujing";
            de.Updated += De_Updated;
            de.Save();

            Assert.IsNotNull(de);
            ExtractItem ei = de.CreateExtract("minnor", "镜像1相对路径");

            ei.Deleted += Ei_Deleted;
            Assert.IsNotNull(ei);
            ei.Delete();
            //Assert.AreEqual(de.ExtractItems.Count(), 0);
            de.Deleted += De_Deleted;
            de.Delete();
            Console.ReadKey();
            //绝对路径
            //de = @case.CreateDeviceExtraction("andrion绝对路径",directory: @"G:\XLY\SpfData");
            //Assert.IsNotNull(de);
            //ei = de.CreateExtract("minnor", @"G:\XLY\SpfData\镜像1绝对路径");
            //Assert.IsNotNull(ei);
            //ei.Delete();
            //Assert.AreEqual(de.ExtractItems.Count(), 0);
            //de.Delete();

            //Assert.IsFalse(de.Existed);
            @case.Delete();
        }