alttester / alttester/AltTester-Unity-SDK

The GetComponentProperty fails when attempting to retrieve a float or double type key from a Dictionary-typed property

Đang mở
#1,818 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
bug
Ngôn ngữ chính
C#
Star
121
Fork
24
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

**Steps to reproduce**:

1. Add a Dictionary having a float or double type key property to a component
e.g.
```
public Dictionary floatDict = new Dictionary();
public Dictionary doubleDict = new Dictionary();
```
3. Populate it
e.g.
```
floatDict.Add(1.5f, "float one");
doubleDict.Add(2.71, "e approx");
```
5. Attempt to retrieve the key values.
e.g.
```
[TestCase("floatDict.1.5", "float one")]
[TestCase("doubleDict.2.71", "e approx")]

public void TestPrimitiveDictionaries(string propertyPath, string expectedValue)
{
var altElement = altDriver.FindObject(By.NAME, "Capsule");
Assert.NotNull(altElement, "GameObject 'Capsule' not found");

var actualValue = altElement.WaitForComponentProperty(
"AltExampleScriptCapsule",
propertyPath,
expectedValue,
"Assembly-CSharp"
);

Assert.AreEqual(expectedValue, actualValue, $"Mismatch for property {propertyPath}");
}
```
**Actual result**: Retrieving the key fails

![Image](https://github.com/user-attachments/assets/8130e81b-865a-4b4a-97d0-f4c52c3fcedb)

**Expected result**: the float and double key values are retrieved

**Note**: it is not very common to define a float or double key in a dictionary, so this issue can be treated with low priority.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.