예제 #1
0
        public void MspModelCreationTypesCheckUpdateComponents()
        {
            CreateProductUpdateInfos();

              // Создаем модель.
              MspModel model = new MspModel();
              model.Load(new MspModelLoadingParameters(oldUpdzip, newUpdzip, MspCreationTypes.AllInOne));

              Assert.AreEqual(2, model.UpdateComponents.Length);
              foreach (string id in new string[] { "Component12", "Component22" })
              {
            Assert.IsTrue(model.UpdateComponents.Select(v => v.Id).Contains(id));
              }
        }
예제 #2
0
        public void MspModelCreationTypesAllInOne()
        {
            CreateProductUpdateInfos();

              // Создаем модель.
              MspModel model = new MspModel();
              model.Load(new MspModelLoadingParameters(oldUpdzip, newUpdzip, MspCreationTypes.AllInOne));

              // Patch должен быть один.
              Assert.AreEqual(1, model.RootItem.Items.Count);
              Assert.AreEqual(typeof(WixPatchElement), model.RootItem.Items[0].GetType());
              // Должно быть два PatchComponent.
              Assert.AreEqual(2, model.RootItem.Items[0].Items.Count);
              Assert.AreEqual(typeof(WixPatchComponentElement), model.RootItem.Items[0].Items[0].GetType());
              Assert.AreEqual(typeof(WixPatchComponentElement), model.RootItem.Items[0].Items[1].GetType());
        }
예제 #3
0
        public void MspModelCreationTypesEachInOne()
        {
            CreateProductUpdateInfos();

              // Создаем модель.
              MspModel model = new MspModel();
              model.Load(new MspModelLoadingParameters(oldUpdzip, newUpdzip, MspCreationTypes.EachInOne));

              // Patch должено быть два.
              Assert.AreEqual(2, model.RootItem.Items.Count);
              // В каждом Patch один Component.
              for (int i = 0; i < 2; i++)
              {
            Assert.AreEqual(typeof(WixPatchElement), model.RootItem.Items[i].GetType());
            Assert.AreEqual(1, model.RootItem.Items[i].Items.Count);
            Assert.AreEqual(typeof(WixPatchComponentElement), model.RootItem.Items[i].Items[0].GetType());
              }
        }
예제 #4
0
 public void MspModelRootElement()
 {
     BuilderModel model = new MspModel();
       Assert.IsInstanceOfType(model.RootItem, typeof(WixPatchRootElement));
 }
예제 #5
0
        public void MspModelCreationTypesEmpty()
        {
            CreateProductUpdateInfos();

              // Создаем модель.
              MspModel model = new MspModel();
              model.Load(new MspModelLoadingParameters(oldUpdzip, newUpdzip, MspCreationTypes.Empty));

              Assert.AreEqual(0, model.RootItem.Items.Count);
        }