public override UserMedal CheckIfFullfiledRequirement(SpontaneousUserModel statistic, UserActivity activity)
        {
            if (!IfAlreadyHave(statistic))
            {
                if (statistic != null && statistic.UserMedalsList != null && statistic.UserActivityList.Count > 0)
                {
                    //Check if current activity is meets requirement
                    string activityName = activity.GetType().Name;
                    int avtivityCount = 0;
                    if (activity is MedalViewActivity)
                    {
                        avtivityCount = statistic.GetActivityCount(activityName, ((MedalViewActivity)activity).MedalType);
                    }
                    else
                    {
                        avtivityCount = statistic.GetActivityCount(activityName);
                    }

                    //Check if current activity is in requirement list
                    if (RequirementsList.FirstOrDefault(r => r.Activity.GetType().Name == activityName) != null)
                    {
                        if (avtivityCount >= RequirementsList.FirstOrDefault(r => r.Activity.GetType().Name == activityName).Count)
                        {
                            //Current activity is meets requirement
                            //Check if meets other requirements necessary for the medal
                            foreach (var requirement in RequirementsList)
                            {
                                activityName = requirement.Activity.GetType().Name;
                                //avtivityCount = statistic.GetActivityCount(activityName);
                                if (requirement.Activity is MedalViewActivity)
                                {
                                    avtivityCount = statistic.GetActivityCount(activityName, "AddRestaurantMedal");
                                }
                                else
                                {
                                    avtivityCount = statistic.GetActivityCount(activityName);
                                }
                                if (!(avtivityCount >= RequirementsList.FirstOrDefault(r => r.Activity.GetType().Name == activityName).Count))
                                {
                                    log.InfoFormat("[AddRestaurantMedalChecker: CheckIfFullfiledRequirement] Still not win AddRestaurant Medal. avtivityCount={0}", avtivityCount);
                                    return null;
                                }
                            }
                            UserMedal medal = new AddRestaurantMedal();
                            log.InfoFormat("[AddRestaurantMedalChecker: CheckIfFullfiledRequirement] Win AddRestaurant Medal. avtivityCount={0}", avtivityCount);
                            return medal;
                        }
                    }
                    else
                    {
                        log.InfoFormat("[AddRestaurantMedalChecker: CheckIfFullfiledRequirement] Still not win AddRestaurant Medal. avtivityCount={0}", avtivityCount);
                    }
                }
            }
            return null;
        }
        public void GetMedalsTest_Should_ReturnListOfUserMedal_ifMedalWithNullCouponMustCreatNewCoupon()
        {
            //Arrange
            SpontaneousUserModel userModel = new SpontaneousUserModel()
            {
                UserActivityList = new List<UserActivity>(),
                UserMedalsList = new List<UserMedal>()
            };

            DateTime time = DateTime.UtcNow;
            CouponType coupon = new CouponType()
            {
                Id = new ObjectId("51aae3bf3720e811c09fb107"),
                Description = "test coupon nomber 1",
                RestaurantsIDs = new List<string>() { "51b02f863720e81d6cf62a3b", "51cbee273720e80ea00922ae" },
                ValidFrom = new DateTime(0),
                ValidUntil = time
            };
            UserMedal medal1 = new WelcomeUserMedal();
            UserMedal medal2 = new RestaurantAdviserMedal();
            UserMedal medal3 = new RestaurantAdviserMedal();
            medal3.Coupon = coupon;
            UserMedal medal4 = new FlowCompleteMedal();
            UserMedal medal5 = new AddRestaurantMedal();

            userModel.UserMedalsList.Add(medal1);
            userModel.UserMedalsList.Add(medal2);
            userModel.UserMedalsList.Add(medal3);
            userModel.UserMedalsList.Add(medal4);
            userModel.UserMedalsList.Add(medal5);

            //Act
            List<UserMedal> list = serviceLayer.GetMedals();

            //Assert
            Assert.IsFalse(list.Exists(m => m.Coupon == null));
        }