Beispiel #1
0
        public IEnumerable <ProxySync.PreCommitResponse> TestPreCommitVersionCompare_FacebookUser(long differentBetweenHostingVersionAndLocalVersion, out ProxySync.ObjectState facebookUserObjectState)
        {
            facebookUserObjectState                  = NextObjectState();
            facebookUserObjectState.HostingId        = -1;
            facebookUserObjectState.ObjectDetailType = (int)SEMObjectDetailType.FacebookUser;
            facebookUserObjectState.IsVersionCompare = true;
            facebookUserObjectState.EngineType       = (int)SearchEngineType.Facebook;
            facebookUserObjectState.LocalId          = SyncDataServiceHelper.GenerateLocalId(facebookUserObjectState);

            TblFacebookUser facebookUserEntity = NextFacebookUserEntity();

            facebookUserEntity.Id = facebookUserObjectState.ObjectId;

            facebookUserEntity.Version = facebookUserObjectState.LocalVersion + differentBetweenHostingVersionAndLocalVersion;

            RegisterCreatedFacebookUserEntityForCleanup(facebookUserEntity);
            InsertFacebookUserIntoDB(facebookUserEntity);

            ProxySync.PreCommitResponse[] responses = null;
            ProxySync.ObjectState         facebookUserObejctStateForLambdaExpression = facebookUserObjectState;
            WCFHelper.Using <SyncDataServiceClient>(new SyncDataServiceClient(), client =>
            {
                responses = client.PreCommit(new ProxySync.ObjectState[] { facebookUserObejctStateForLambdaExpression });
            });
            return(responses);
        }
        public void TestAddUser_FacebookUser()
        {
            CommandResponse.Facebook.AddCommand.AddFacebookUserCommand addFacebookUserCommand;
            TblFacebookUser responseFacebookUser = FacebookServiceHelper.TestAddUser_FacebookUser(out addFacebookUserCommand);

            Assert.IsNotNull(responseFacebookUser, "The responseRow object cannot be NULL!!");
            Assert.AreEqual(addFacebookUserCommand.Id, responseFacebookUser.Id, "The response facebookUser's Id should be equal to the one before Insertint the Database!!");
            Assert.AreEqual(addFacebookUserCommand.LocalId, responseFacebookUser.LocalId, "The response facebookUser's LocalId should be equal to the one before Insertint the Database!!");
            Assert.AreEqual(addFacebookUserCommand.Email, responseFacebookUser.Email, "The response facebookUser's Email should be equal to the one before Insertint the Database!!");
            Assert.AreEqual(addFacebookUserCommand.ApiKey, responseFacebookUser.ApiKey, "The response facebookUser's ApiKey should be equal to the one before Insertint the Database!!");
            Assert.AreEqual(addFacebookUserCommand.ApplicationSecret, responseFacebookUser.ApplicationSecret, "The response facebookUser's ApplicationSecret should be equal to the one before Insertint the Database!!");
            Assert.AreEqual(addFacebookUserCommand.ApplicationId, responseFacebookUser.ApplicationId, "The response facebookUser's ApplicationId should be equal to the one before Insertint the Database!!");
            Assert.AreEqual(addFacebookUserCommand.AccessToken, responseFacebookUser.Accesstoken, "The response facebookUser's AccessToken should be equal to the one before Insertint the Database!!");
            Assert.AreEqual(addFacebookUserCommand.UserName, responseFacebookUser.UserName, "The response facebookUser's UserName should be equal to the one before Insertint the Database!!");
            Assert.AreEqual(addFacebookUserCommand.ImagePath, responseFacebookUser.ImagePath, "The response facebookUser's ImagePath should be equal to the one before Insertint the Database!!");
            Assert.AreEqual(addFacebookUserCommand.ImageUrl, responseFacebookUser.ImageUrl, "The response facebookUser's ImageUrl should be equal to the one before Insertint the Database!!");
        }
Beispiel #3
0
        public TblFacebookUser NextFacebookUserEntity()
        {
            TblFacebookUser tblFacebookUser = new TblFacebookUser();

            tblFacebookUser.Accesstoken       = RandomData.NextUnicodeWord(500);
            tblFacebookUser.ApiKey            = RandomData.NextUnicodeWord(500);
            tblFacebookUser.ApplicationId     = RandomData.NextUnicodeWord(500);
            tblFacebookUser.ApplicationSecret = RandomData.NextUnicodeWord(500);
            tblFacebookUser.Email             = RandomData.NextAsciiEmail(20);
            tblFacebookUser.Id             = (Int64)RandomData.NextUInt32();
            tblFacebookUser.ImagePath      = RandomData.NextEnglishWordLowercase(10);
            tblFacebookUser.ImageUrl       = RandomData.NextAsciiUrl(20);
            tblFacebookUser.LastUpdateTime = RandomData.NextDateTime(new TimeSpan(1, 0, 0, 0));
            tblFacebookUser.LocalId        = (Int64)RandomData.NextUInt32();
            tblFacebookUser.LocalState     = RandomData.NextByte();
            tblFacebookUser.LocalStatus    = RandomData.NextByte();
            tblFacebookUser.Password       = RandomData.NextUnicodeWord(20);
            tblFacebookUser.SessionKey     = RandomData.NextUnicodeWord(20);
            tblFacebookUser.SessionSecret  = RandomData.NextUnicodeWord(20);
            tblFacebookUser.UserName       = RandomData.NextUnicodeWord(20);
            tblFacebookUser.Version        = (Int64)RandomData.NextInt16();
            return(tblFacebookUser);
        }
Beispiel #4
0
        public TblFacebookUser TestAddUser_FacebookUser(out AddFacebookUserCommand addFacebookUserCommand)
        {
            addFacebookUserCommand = NextFacebookUserCommand();
            TblFacebookUser facebookUserEntity = NextFacebookUserEntity();

            facebookUserEntity.Id      = addFacebookUserCommand.Id;
            facebookUserEntity.LocalId = addFacebookUserCommand.LocalId;

            RegisterCreatedFacebookUserEntitiesForCleanup(facebookUserEntity);
            InsertFacebookUserIntoDatabsase(facebookUserEntity);
            AddFacebookUserCommand facebookUserCommandForLambdaExpression = addFacebookUserCommand;

            WCFHelper.Using <WCFServiceProxy <IFacebookService> >(new WCFServiceProxy <IFacebookService>("FacebookService"),
                                                                  client =>
            {
                client.Service.AddUser(facebookUserCommandForLambdaExpression);
            });

            long facebookUserId = addFacebookUserCommand.Id;

            facebookUserEntity = GetFacebookUserEntity(facebookUserId);
            return(facebookUserEntity);
        }
Beispiel #5
0
        public TblFacebookUser NextFacebookUserEntity()
        {
            TblFacebookUser tblFacebookUser = new TblFacebookUser();

            tblFacebookUser.LocalStatus       = RandomData.NextByte();
            tblFacebookUser.LocalState        = RandomData.NextByte();
            tblFacebookUser.LastUpdateTime    = RandomData.NextDateTime(new TimeSpan(1, 0, 0, 0));
            tblFacebookUser.LocalId           = RandomData.NextUInt32();
            tblFacebookUser.Id                = RandomData.NextUInt32();
            tblFacebookUser.Email             = RandomData.NextUnicodeEmail(30);
            tblFacebookUser.Password          = RandomData.NextDigits(20);
            tblFacebookUser.ApiKey            = RandomData.NextAsciiWord(20, 35);
            tblFacebookUser.ApplicationSecret = RandomData.NextAsciiWord(28, 32);
            tblFacebookUser.ApplicationId     = RandomData.NextDigits(16);
            tblFacebookUser.SessionSecret     = RandomData.NextAsciiWord(28, 32);
            tblFacebookUser.SessionKey        = RandomData.NextAsciiWord(20, 35);
            tblFacebookUser.Accesstoken       = RandomData.NextAsciiWord(100, 112);
            tblFacebookUser.UserName          = RandomData.NextUnicodeWord(15);
            tblFacebookUser.ImagePath         = RandomData.NextUnicodeUrl(30);
            tblFacebookUser.ImageUrl          = RandomData.NextUnicodeUrl(50);
            tblFacebookUser.Version           = RandomData.NextUInt16();

            return(tblFacebookUser);
        }
Beispiel #6
0
 public void RegisterCreatedFacebookUserEntityForCleanup(TblFacebookUser facebookUserEntity)
 {
     this.createdFacebookUserEntitiesFroCleanup.Add(facebookUserEntity);
 }
Beispiel #7
0
 public void InsertFacebookUserIntoDB(TblFacebookUser facebookUserEntity)
 {
     SEMObjects.TblFacebookUser.InsertOnSubmit(facebookUserEntity);
     SEMObjects.SubmitChanges();
 }