예제 #1
0
        public void TestMethod1()
        {
            var dataReader = MockRepository.GenerateStub<IDnaDataReader>();


            var adapter = new OpenSocialActivityDataReaderAdapter(dataReader);

            OpenSocialActivity activity = adapter;
            

        }
        public void OpenSocialActivityDataReaderAdapter_StandardResponse_ReturnsCorrectObject()
        {
            MockRepository mocks = new MockRepository();
            IDnaDataReader dataReader = CreateDefaultReader(ref mocks);
            mocks.ReplayAll();

            OpenSocialActivityDataReaderAdapter target = new OpenSocialActivityDataReaderAdapter(dataReader);

            Assert.AreEqual("bbc:dna:1:1:1", target.ObjectUri);
            
        }
        public void OpenSocialActivityDataReaderAdapter_IPlayerTvResponse_ReturnsCorrectObject()
        {
            MockRepository mocks = new MockRepository();
            IDnaDataReader dataReader = CreateDefaultReader(ref mocks, "bbc:programme:{commentforumuid}", "recommend_comment",
                "pid");

            mocks.ReplayAll();

            OpenSocialActivityDataReaderAdapter target = new OpenSocialActivityDataReaderAdapter(dataReader);

            Assert.AreEqual("bbc:programme:pid", target.ObjectUri);
            Assert.AreEqual("recommend_comment", target.CustomActivityType);

        }
예제 #4
0
        public static ISnesActivity CreateSnesActivity(IDnaLogger logger, IDnaDataReader currentRow)
        {
            var openSocialActivity = new OpenSocialActivityDataReaderAdapter(currentRow);
            var eventData = new SnesEventDataReaderAdapter(currentRow);

            ISnesActivity activity;

            switch (eventData.ActivityType)
            {
                case 19:
                    activity = CommentActivityBase.CreateActivity(openSocialActivity, eventData);
                    break;
                case 20:
                    activity = RevokeCommentActivity.CreateActivity(openSocialActivity, eventData);
                    break;
                default:
                    activity = new UnexpectedActivity();
                    break;
            }
            return activity;
        }