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)); }
public ClusterMembers(ObservedClusterMembers observedClusterMembers, HighAvailabilityMemberStateMachine stateMachine) { this._observedClusterMembers = observedClusterMembers; this._stateMachine = stateMachine; }
public HighAvailabilityDiagnostics(HighAvailabilityMemberStateMachine memberStateMachine, ClusterClient clusterClient) { this._memberStateMachine = memberStateMachine; this._clusterClient = clusterClient; }