Example #1
0
 private static CpuNodeDto CreateChild(CpuNodeModel cpuNodeModel)
 {
     return(new CpuNodeDto
     {
         Name = cpuNodeModel.Name,
         Value = cpuNodeModel.Value,
         NodeType = cpuNodeModel.NodeType,
         OsIndex = cpuNodeModel.OsIndex,
         Children = cpuNodeModel.Children?.Select(CreateChild).ToList(),
         MemoryChildren = cpuNodeModel.MemoryChildren?.Select(CreateChild).ToList()
     });
 }
Example #2
0
        public static void AssertTopology(CpuNodeModel model, CpuNodeDto dto)
        {
            Assert.AreEqual(model.Name, dto.Name);
            Assert.AreEqual(model.Value, dto.Value);
            Assert.AreEqual(model.NodeType, dto.NodeType);
            Assert.AreEqual(model.OsIndex, dto.OsIndex);

            AssertCollectionsAreEqual(model.MemoryChildren, dto.MemoryChildren, (a, b) =>
            {
                AssertTopology(a, b);
                return(true);
            });

            AssertCollectionsAreEqual(model.Children, dto.Children, (a, b) =>
            {
                AssertTopology(a, b);
                return(true);
            });
        }