Inheritance: System.Data.Objects.DataClasses.EntityObject
        public void TestContestantRegister()
        {
            //
            // TODO: Add test logic here
            //
            var contestant = new Contestant
            {
                Profile = new Models.Profile
                {
                    Tagline = "tagline",
                    Interest = "interest",
                    Characteristic = "chara",
                    RegistrationPost = "registrationPost",
                    ActingCute = "ActingCute",
                    JoinedDate = new DateTime(2011, 7, 1)
                }
            };
            //var profile = new Saimoe.Models.EF.Profile();
            //profile.InjectFrom(contestantRegistration);

            // var profile = Mapper.Map<ContestantRegistration, Saimoe.Models.Profile>(contestantRegistration);

            // var registration = Mapper.Map<Saimoe.Models.Profile, ContestantRegistration>(profile);

            // Assert.AreEqual(contestantRegistration.ActingCute, profile.ActingCute);
            //Assert.AreEqual(contestantRegistration.JoiningDateYear, profile.JoinedDate.Year);
            //Assert.AreEqual(contestantRegistration.JoiningDateMonth, profile.JoinedDate.Month);
        }
        /// <summary>
        /// Add a contestant to database
        /// </summary>
        /// <param name="googlePlusId">Id of google plus</param>
        /// <param name="registrationInfo">Registration info of contestant</param>
        public void AddContestant(Contestant contestant)
        {
            if (contestant == null)
            {
                throw new ArgumentNullException("Contestant Registration");
            }

            //TODO: move this part to the constructutor of Contestant
            contestant.CreatedDate = contestant.LastLoginDate = DateTime.Now;
            _contestantRepository.AddContestant(contestant);
        }
        public void TestAddContestant()
        {
            //
            // TODO: Add test logic here
            //
            var gPlusId = "107711263447378891785";
            var contestantRegistration = new Contestant(
                gPlusId,
                new Profile
                {
                    Tagline = "tagline",
                    Interest = "interest",
                    Characteristic = "chara",
                    RegistrationPost = "registrationPost",
                    ActingCute = "ActingCute",
                    JoinedDate = new DateTime(2011, 7, 1),
                }
            );

            var contestantService = new ContestantService();
            contestantService.AddContestant(contestantRegistration);
            var contestant = contestantService.GetContestant(gPlusId);
            Assert.IsNotNull(contestant);
        }
 /// <summary>
 /// Create a new Contestant object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="googlePlusId">Initial value of the GooglePlusId property.</param>
 /// <param name="createdDate">Initial value of the CreatedDate property.</param>
 /// <param name="lastLoginDate">Initial value of the LastLoginDate property.</param>
 public static Contestant CreateContestant(global::System.Int32 id, global::System.String googlePlusId, global::System.DateTime createdDate, global::System.DateTime lastLoginDate)
 {
     Contestant contestant = new Contestant();
     contestant.Id = id;
     contestant.GooglePlusId = googlePlusId;
     contestant.CreatedDate = createdDate;
     contestant.LastLoginDate = lastLoginDate;
     return contestant;
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the Contestants EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToContestants(Contestant contestant)
 {
     base.AddObject("Contestants", contestant);
 }
 /// <summary>
 /// Add a new contestant
 /// </summary>
 /// <param name="contestant">the new contestant</param>
 internal void AddContestant(Contestant contestant)
 {
     _dbContext.Contestants.AddObject(contestant);
     _dbContext.SaveChanges();
 }