示例#1
0
    public void ProfileData_AddMarkerName_AddsMarkerAndContainsName()
    {
        var data        = new ProfileData();
        var markerNames = new List <string>()
        {
            "Marker01",
            "Marker02",
            "Marker03",
            "Marker04"
        };

        var markerList = new List <ProfileMarker>();

        for (int i = 0; i < 10; ++i)
        {
            var marker = new ProfileMarker()
            {
                msMarkerTotal = 0.5f,
                depth         = i
            };

            int expectedIndex = i % markerNames.Count;
            data.AddMarkerName(markerNames[expectedIndex], marker);
            markerList.Add(marker);

            Assert.IsTrue(expectedIndex == marker.nameIndex, "Index mismatch at: " + i + " , " + marker.nameIndex);;
        }

        for (int i = 0; i < markerList.Count; ++i)
        {
            var curName = data.GetMarkerName(markerList[i]);
            Assert.IsTrue(markerNames.Contains(curName));
        }
    }