Beispiel #1
0
        private Stopwatch GetTimer(NetUser user)
        {
            if (user.GetLocal <Stopwatch>(TimerKey) == null)
            {
                user.SetLocal <Stopwatch>(TimerKey, new Stopwatch());
            }

            return(user.GetLocal <Stopwatch>(TimerKey));
        }
Beispiel #2
0
        public void NetUser_SetLocal_StringKey_GetLocalReturnsValue()
        {
            NetUser user = new NetUser();

            user.SetLocal("key", "data");
            var data = user.GetLocal("key");

            Assert.IsTrue(data.Equals("data"));
        }
Beispiel #3
0
        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));
        }
Beispiel #4
0
 private Dictionary <int, double> GetUserTimeMap(NetUser user)
 {
     return(user.GetLocal <Dictionary <int, double> >(Key_UserDateMap));
 }
Beispiel #5
0
 private Dictionary <int, byte[]> GetUserMap(NetUser user)
 {
     return(user.GetLocal <Dictionary <int, byte[]> >(Key_UserMap));
 }
Beispiel #6
0
 private int GetUserId(NetUser user)
 {
     return(user.GetLocal <int>(Key_UserId));
 }
Beispiel #7
0
 public double GetPing(NetUser user)
 {
     return(user.GetLocal <double>(LatencyKey));
 }
Beispiel #8
0
        public void NetUser_GetLocal_ReturnsDefault()
        {
            NetUser user = new NetUser();

            Assert.IsTrue(user.GetLocal <TestModel>("key") == null);
        }