Test UI on Fake Players

Is there any way to spawn BasePlayer and pass any chatCommand that BasePlayer?
Im trying to do ui plugin and for testing I have run rust and join my server, can I test ui without joining server?

tried something like this:

BaseEntity baseEntity = GameManager.server.CreateEntity("assets/prefabs/player/player.prefab", default(Vector3), default(Quaternion), true);
BasePlayer myPlayer = baseEntity.ToPlayer();

[ChatCommand("menu")]
private void chatCommand_menu(BasePlayer player){
...
}

chatCommand_menu(myPlayer)​
this gives errot "myPlayer doesnot exist in a current context"

can I access "entity.spawn player" as BasePlayer somehow?

You might be able to run the console command with

BasePlayer.SendConsoleCommand()​

However, this will likely only work for admin players.

It's hard to see where you are getting that warning since this is a pretty small code sample. However another issue is that you don't seem to be spawning the entity in the first place. After creating an entity with GameManager.server.CreateEntity() you need to call .Spawn() on the BaseEntity.