private Stopwatch GetTimer(NetUser user) { if (user.GetLocal <Stopwatch>(TimerKey) == null) { user.SetLocal <Stopwatch>(TimerKey, new Stopwatch()); } return(user.GetLocal <Stopwatch>(TimerKey)); }
public void NetUser_SetLocal_StringKey_GetLocalReturnsValue() { NetUser user = new NetUser(); user.SetLocal("key", "data"); var data = user.GetLocal("key"); Assert.IsTrue(data.Equals("data")); }
public void NetUser_SetLocal_GenericKey_GetLocalReturnsValue() { NetUser user = new NetUser(); TestModel model = new TestModel(); model.Data = "data"; user.SetLocal <TestModel>("key", model); var m = user.GetLocal <TestModel>("key"); Assert.IsTrue(m.Data.Equals(model.Data)); }
private Dictionary <int, double> GetUserTimeMap(NetUser user) { return(user.GetLocal <Dictionary <int, double> >(Key_UserDateMap)); }
private Dictionary <int, byte[]> GetUserMap(NetUser user) { return(user.GetLocal <Dictionary <int, byte[]> >(Key_UserMap)); }
private int GetUserId(NetUser user) { return(user.GetLocal <int>(Key_UserId)); }
public double GetPing(NetUser user) { return(user.GetLocal <double>(LatencyKey)); }
public void NetUser_GetLocal_ReturnsDefault() { NetUser user = new NetUser(); Assert.IsTrue(user.GetLocal <TestModel>("key") == null); }