Example #1
0
        private void CheckBaseInfo <T>(ITypedCallInfo <T> info) where T : IOperationRequest
        {
            Assert.IsNotNull(info);

            Assert.IsTrue(this.calledSetup);

            Assert.IsNotNull(info.OperationRequest);
            Assert.IsNotNull(info.Request);
            if (!(info is IBeforeCloseGameCallInfo || info is ICloseGameCallInfo))
            {
                Assert.IsNotNull(info.Request.Parameters);
                Assert.AreNotEqual(0, info.Request.OperationCode);
                Assert.IsNotNull(info.UserId);
                Assert.IsNotNull(info.Nickname);
#if PLUGINS_0_9
                Assert.IsNotNull(info.Username);
#endif
            }
            else
            {
                Assert.IsNull(info.UserId);
                Assert.IsNull(info.Nickname);
#if PLUGINS_0_9
                Assert.IsNotNull(info.Username);
#endif
                Assert.IsNull(info.Request.Parameters);
                Assert.AreEqual(0, info.Request.OperationCode);
            }

            //TBD
            //Assert.IsNotNull(info.AuthResultsSecure);
        }
Example #2
0
        public static string ToStr <T>(this ITypedCallInfo <T> info) where T : IOperationRequest
        {
            StringBuilder builder = new StringBuilder();

            if (info == null)
            {
                builder.AppendLine(string.Format("ITypedCallInfo=null"));
            }
            else
            {
                builder.AppendLine(string.Format("ITypedCallInfo.UserId={0}", info.UserId));
                builder.AppendLine(string.Format("ITypedCallInfo.Nickname={0}", info.Nickname));
                builder.AppendLine(info.AuthCookie.ToStr <string, object>("ITypedCallInfo.AuthCookie"));
                builder.AppendLine((info.Request as IOperationRequest).ToStr());
            }

            return(builder.ToString());
        }