public void ResourceSave() { var resolver = CompositeResolver.Create(PrimitiveObjectResolver.Instance, StandardResolver.Instance); var user = new CoflnetUser(); user.AssignId(); user.OnlyFriendsMessage = true; user.FirstName = "Bernd das Brot ist"; DataController.Instance.SaveData($"res/{user.Id.ToString()}aaaa", MessagePackSerializer.Typeless.Serialize(user)); EntityManager.Instance.Save(user.Id, true); }
public void ResourceSaveAndLoad() { //CompositeResolver.RegisterAndSetAsDefault(PrimitiveObjectResolver.Instance, StandardResolver.Instance); var user = new CoflnetUser(); user.AssignId(); user.OnlyFriendsMessage = true; user.FirstName = "Bernd das Brot"; DataController.Instance.SaveData($"res/{user.Id.ToString()}aaaa", MessagePack.MessagePackSerializer.Typeless.Serialize(user)); EntityManager.Instance.Save(user.Id, true); var loadedUser = EntityManager.Instance.GetEntity <CoflnetUser> (user.Id); Assert.AreEqual(user.FirstName, loadedUser.FirstName); }