public void KeepMajority_must_down_remaining_nodes_if_unreachable_nodes_have_majority() { var unreachable = Members(Member(e), Member(d), Member(c)); var remaining = Members(Member(a), Member(b)); var strategy = new KeepMajority(); strategy.Apply(new NetworkPartitionContext(unreachable, remaining)).Should().Equal(remaining); }
public void KeepMajority_must_keep_the_part_with_the_lowest_nodes_address_in_case_of_equal_size() { var unreachable = Members(Member(e), Member(d)); var remaining = Members(Member(a), Member(b)); // `a` is the lowest address var strategy = new KeepMajority(); strategy.Apply(new NetworkPartitionContext(unreachable, remaining)).Should().Equal(unreachable); }
public void KeepMajority_must_keep_the_part_with_the_lowest_nodes_address_in_case_of_equal_size_role_based() { const string role = "test"; var unreachable = Members(Member(e, role: role), Member(d, role: role)); var remaining = Members(Member(a, role: role), Member(b, role: role), Member(c)); // `a` is the lowest address var strategy = new KeepMajority(role); strategy.Apply(new NetworkPartitionContext(unreachable, remaining)).Should().Equal(unreachable); }
public void KeepMajority_must_down_remaining_nodes_if_unreachable_nodes_have_majority_role_based() { const string role = "test"; var unreachable = Members(Member(e, role: role), Member(d, role: role)); var remaining = Members(Member(a, role: role), Member(b), Member(c)); var strategy = new KeepMajority(role); strategy.Apply(new NetworkPartitionContext(unreachable, remaining)).Should().Equal(remaining); }