public void TryGetClassNetCachePropertyDoesNotThrowTest() { var guidCache = new NetGuidCache(); var parser = new NetFieldParser(guidCache, ParseMode.Full, "Unreal.Core.Test"); var result = parser.TryGetClassNetCacheProperty("doesnotexist", "classnetcache1", out var info); Assert.False(result); result = parser.TryGetClassNetCacheProperty("doesnotexist", "classnetcache3", out info); Assert.False(result); }
public void TryGetClassNetCachePropertyTest() { var guidCache = new NetGuidCache(); var parser = new NetFieldParser(guidCache, ParseMode.Full, "Unreal.Core.Test"); var result = parser.TryGetClassNetCacheProperty("DefaultRPCProperty", "classnetcache1", out var info); Assert.True(result); Assert.Equal("DefaultRPCProperty", info.Name); Assert.Equal("path-DefaultRPCProperty", info.PathName); Assert.True(info.EnablePropertyChecksum); Assert.False(info.IsCustomStruct); Assert.False(info.IsFunction); result = parser.TryGetClassNetCacheProperty("RPCPropertyWithChecksum", "classnetcache1", out info); Assert.True(result); Assert.Equal("RPCPropertyWithChecksum", info.Name); Assert.Equal("path-RPCPropertyWithChecksum", info.PathName); Assert.False(info.EnablePropertyChecksum); Assert.False(info.IsCustomStruct); Assert.False(info.IsFunction); result = parser.TryGetClassNetCacheProperty("FunctionRPCProperty", "classnetcache1", out info); Assert.True(result); Assert.Equal("FunctionRPCProperty", info.Name); Assert.Equal("path-FunctionRPCProperty", info.PathName); Assert.True(info.EnablePropertyChecksum); Assert.False(info.IsCustomStruct); Assert.True(info.IsFunction); result = parser.TryGetClassNetCacheProperty("CustomRPCProperty", "classnetcache1", out info); Assert.True(result); Assert.Equal("CustomRPCProperty", info.Name); Assert.Equal("path-CustomRPCProperty", info.PathName); Assert.True(info.EnablePropertyChecksum); Assert.True(info.IsCustomStruct); Assert.False(info.IsFunction); Assert.True(typeof(int) == info.PropertyInfo.PropertyType); }