public void Add(UserStat userStat)
		{
			this.TimesRecommended += userStat.TimesRecommended;
			this.TimesFlowed += userStat.TimesFlowed;
			this.TimesPreviewed += userStat.TimesPreviewed;
			this.TimesPurchased += userStat.TimesPurchased;
		}
 public void Add(UserStat userStat)
 {
     this.TimesRecommended += userStat.TimesRecommended;
     this.TimesFlowed      += userStat.TimesFlowed;
     this.TimesPreviewed   += userStat.TimesPreviewed;
     this.TimesPurchased   += userStat.TimesPurchased;
 }
		public void Can_serialize_empty_UserStat()
		{
			var userStat = new UserStat();
			var dtoStr = TypeSerializer.SerializeToString(userStat);

			Assert.That(dtoStr, Is.EqualTo("\"00000000000000000000000000000000:0:0:0:0:0\""));

			SerializeAndCompare(userStat);
		}
        public void Can_serialize_empty_UserStat()
        {
            var userStat = new UserStat();
            var dtoStr   = TypeSerializer.SerializeToString(userStat);

            Assert.That(dtoStr, Is.EqualTo("\"00000000000000000000000000000000:0:0:0:0:0\""));

            SerializeAndCompare(userStat);
        }
		public static UserStat Parse(string userStatString)
		{
			var parts = userStatString.Split(':');
			if (parts.Length != 6)
				throw new ArgumentException("userStatString must have 6 parts");

			var i = 0;
			var userStat = new UserStat {
				UserId = new Guid(parts[i++]),
				TimesRecommended = int.Parse(parts[i++]),
				TimesPurchased = int.Parse(parts[i++]),
				TimesFlowed = int.Parse(parts[i++]),
				TimesPreviewed = int.Parse(parts[i++]),
			};
			return userStat;
		}
Exemplo n.º 6
0
        public static UserStat Parse(string userStatString)
        {
            var parts = userStatString.Split(':');

            if (parts.Length != 6)
            {
                throw new ArgumentException("userStatString must have 6 parts");
            }

            var i        = 0;
            var userStat = new UserStat {
                UserId           = new Guid(parts[i++]),
                TimesRecommended = int.Parse(parts[i++]),
                TimesPurchased   = int.Parse(parts[i++]),
                TimesFlowed      = int.Parse(parts[i++]),
                TimesPreviewed   = int.Parse(parts[i++]),
            };

            return(userStat);
        }