@author: Tsinghua . @description: Manage all business relate to 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);
        }
Ejemplo n.º 2
0
 public ContestantController(ContestantService service)
 {
     this.ContestantService = service;
 }
Ejemplo n.º 3
0
 public ContestantController()
 {
     ContestantService = new ContestantService();
 }
Ejemplo n.º 4
0
 public JoinController(GoogleUser user, ContestantService service)
 {
     this.user = user;
     this.ContestantService = service;
 }
        public void TestUpdateContestant()
        {
            var gPlusId = "107711263447378891785";
            var contestantService = new ContestantService();
            var expect = contestantService.GetContestant(gPlusId);

            expect.Profile.Tagline = expect.Profile.Tagline + DateTime.Now.Minute;
            expect.Profile.Interest = expect.Profile.Interest + DateTime.Now.Minute;
            expect.Profile.Characteristic = expect.Profile.Characteristic + DateTime.Now.Minute;
            expect.Profile.RegistrationPost = expect.Profile.RegistrationPost + DateTime.Now.Minute;
            expect.Profile.ActingCute = expect.Profile.ActingCute + DateTime.Now.Minute;
            expect.Profile.JoinedDate = DateTime.Now;
            var contestantService1 = new ContestantService();
            contestantService1.UpdateContestantProfile(gPlusId, expect.Profile);

            var actual = contestantService1.GetContestant(gPlusId);
            Assert.AreEqual(expect.Profile.Tagline, actual.Profile.Tagline);
            Assert.AreEqual(expect.Profile.ActingCute, actual.Profile.ActingCute);
            Assert.AreEqual(expect.Profile.Interest, actual.Profile.Interest);
            Assert.AreEqual(expect.Profile.Characteristic, actual.Profile.Characteristic);
            Assert.AreEqual(expect.Profile.RegistrationPost, actual.Profile.RegistrationPost);
            Assert.AreEqual(expect.Profile.JoinedDate, actual.Profile.JoinedDate);
        }