优化处理器统计,避免过渡裁剪
智能大石头 authored at 2024-05-22 23:25:13
515.00 B
Stardust
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
using Xunit;

namespace Stardust.ServerTests.Nodes;

public class NodeStatTests
{
    [Fact]
    public void Test1()
    {
        var name = "AMD Ryzen 7 2700 Eight-Core Processor";

        var p = name.IndexOf("-Core");
        if (p > 0) p = name.LastIndexOf(' ', p);
        if (p > 0) name = name[..p].Trim();

        Assert.Equal("AMD Ryzen 7 2700", name);
    }
}