예제 #1
0
        private static System.Func <ClusterMembers> GetClusterMembers(string memberRole, HighAvailabilityMemberState memberState)
        {
            HighAvailabilityMemberStateMachine stateMachine = mock(typeof(HighAvailabilityMemberStateMachine));

            when(stateMachine.CurrentState).thenReturn(memberState);
            ClusterMember clusterMember = spy(new ClusterMember(new InstanceId(1)));

            when(clusterMember.HARole).thenReturn(memberRole);
            ObservedClusterMembers observedClusterMembers = mock(typeof(ObservedClusterMembers));

            when(observedClusterMembers.CurrentMember).thenReturn(clusterMember);
            return(() => new ClusterMembers(observedClusterMembers, stateMachine));
        }
예제 #2
0
 public ClusterMembers(ObservedClusterMembers observedClusterMembers, HighAvailabilityMemberStateMachine stateMachine)
 {
     this._observedClusterMembers = observedClusterMembers;
     this._stateMachine           = stateMachine;
 }
예제 #3
0
 public HighAvailabilityDiagnostics(HighAvailabilityMemberStateMachine memberStateMachine, ClusterClient clusterClient)
 {
     this._memberStateMachine = memberStateMachine;
     this._clusterClient      = clusterClient;
 }