示例#1
0
        public void TestGetParticipantRecord()
        {
            const string token = "tok123";

            const string viewKey            = "MyParticipantRecords";
            var          mockDictionaryList = new List <Dictionary <string, object> >
            {
                new Dictionary <string, object>
                {
                    { "Contact_ID", 99999 },
                    { "dp_RecordID", 100 },
                    { "Email_Address", "email-address" },
                    { "Nickname", "nick-name" },
                    { "Display_Name", "display-name" },
                    { "Age", 99 },
                    { "Group_Leader_Status_ID", 4 }
                }
            };

            _configWrapper.Setup(m => m.GetConfigIntValue("GroupLeaderApproved")).Returns(4);
            _mpServiceMock.Setup(m => m.GetRecordsDict(viewKey, token, string.Empty, string.Empty)).Returns(mockDictionaryList);

            var participant = _fixture.GetParticipantRecord(token);

            _mpServiceMock.VerifyAll();

            Assert.IsNotNull(participant);
            Assert.AreEqual("nick-name", participant.PreferredName);
            Assert.AreEqual("email-address", participant.EmailAddress);
            Assert.AreEqual(100, participant.ParticipantId);
            Assert.IsTrue(participant.ApprovedSmallGroupLeader);
        }