Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

Commit

Permalink
Added test for enumeration.
Browse files Browse the repository at this point in the history
  • Loading branch information
JaXt0r committed Nov 10, 2023
1 parent 54a6d29 commit de7367d
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions PxCs.Tests/PxVmTest.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using PxCs.Data.Vm;
using PxCs.Interface;
Expand Down Expand Up @@ -62,6 +63,20 @@ public void Test_instantiate_Npc_by_name()
PxVm.pxVmDestroy(vmPtr);
}

[Fact]
public void Test_enumerate_Items()
{
var vmPtr = LoadVm(VmGothicPath);

var itemNames = new List<string>();
PxVm.pxVmEnumerateInstancesByClassName(vmPtr, "C_Item", (string name) => itemNames.Add(name));

Assert.True(itemNames.Count > 0, "No items found.");
Assert.True(itemNames.Contains("ITARSCROLLHEAL"), "No scroll found.");

PxVm.pxVmDestroy(vmPtr);
}

[Fact]
public void Test_instantiate_Item_by_name()
{
Expand Down

0 comments on commit de7367d

Please sign in to comment.