public Instance()
 {
     this.NativePartition       = new TNativePartition();
     this.NativeReplicator      = new TNativeReplicator();
     this.NativeStateReplicator = new TNativeStateReplicator();
     this.Broker    = StatefulPartitionTest.CreateDefaultBroker();
     this.Partition = new StatefulServicePartition(
         this.NativePartition,
         ServicePartitionInformation.FromNative(StatefulPartitionTest.DefaultPartitionInfo));
 }
        private static Tuple <StatefulNativePartitionStubForStatefulPartitionCreation, StatefulServicePartition, FabricReplicator> ReplicatorCreationHelper(ReplicatorSettings settings = null)
        {
            StatefulServiceReplicaBroker broker = StatefulPartitionTest.CreateDefaultBroker(settings);
            var nativePartition = new StatefulNativePartitionStubForStatefulPartitionCreation
            {
                NativePartitionInfo = StatefulPartitionTest.DefaultPartitionInfo,
                ReplicatorOut       = new ReplicatorStubBase(),
                StateReplicatorOut  = new StateReplicatorStubBase()
            };

            StatefulServicePartition partition = new StatefulServicePartition(nativePartition, ServicePartitionInformation.FromNative(nativePartition.GetPartitionInfo()));

            var fabricReplicator = partition.CreateReplicator((IStateProvider)broker.Service, settings);

            return(Tuple.Create(nativePartition, partition, fabricReplicator));
        }