Saimoe.Core.ContestantService.UpdateContestantProfile C# (CSharp) Метод

UpdateContestantProfile() публичный Метод

Update profile of contestant
public UpdateContestantProfile ( string googlePlusId, Profile profile ) : void
googlePlusId string
profile Saimoe.Models.Profile
Результат void
        public void UpdateContestantProfile(string googlePlusId, Profile profile)
        {
            if (string.IsNullOrEmpty(googlePlusId))
            {
                throw new ArgumentNullException("GPlus Id");
            }
            if (profile == null)
            {
                throw new ArgumentNullException("contestant");
            }

            _contestantRepository.UpdateProfileByGoogleId(googlePlusId, profile);
        }
    }

Usage Example

        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);
        }