Ejemplo n.º 1
0
        public void TestSmoke_linear()
        {
            Allocation root  = Allocation.NewRoot("root", 1);
            Allocation node1 = root.NewChild("node1", 2);
            Allocation node2 = node1.NewChild("node2", 3);

            Assert.AreEqual("node2", node2.GetDescription());
            Assert.AreEqual(1.0 / 2 / 3, node2.GetFractionOfRoot(), DOUBLE_ERROR_MARGIN);
            Assert.IsTrue(node2.GetParent().IsPresent());
            Assert.AreEqual(node1, node2.GetParent().Get());

            Assert.AreEqual("node1", node1.GetDescription());
            Assert.IsTrue(node1.GetParent().IsPresent());
            Assert.AreEqual(root, node1.GetParent().Get());
            Assert.AreEqual(1.0 / 2, node1.GetFractionOfRoot(), DOUBLE_ERROR_MARGIN);

            Assert.AreEqual("root", root.GetDescription());
            Assert.AreEqual(1, root.GetAllocationUnits());
            Assert.IsFalse(root.GetParent().IsPresent());
            Assert.AreEqual(1.0, root.GetFractionOfRoot(), DOUBLE_ERROR_MARGIN);
        }
Ejemplo n.º 2
0
 public override string ToString()
 {
     return($"ProgressEvent:{progressUnits}:{allocation.GetAllocationUnits()}:{allocation.GetDescription()}");
 }
Ejemplo n.º 3
0
 public override string ToString()
 {
     return($"{(progressUnits==allocation.GetAllocationUnits()?"End":"Start")}:{allocation.GetDescription()}");
 }