Ejemplo n.º 1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldSendNewEntriesAfterMatchingLastEntry() throws Throwable
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldSendNewEntriesAfterMatchingLastEntry()
        {
            // given
            _raftLog.append(_entry0);
            StartLogShipper();

            _logShipper.onMatch(0, new LeaderContext(0, 0));

            // when
            _outbound.clear();

            _raftLog.append(_entry1);
            _logShipper.onNewEntries(0, 0, new RaftLogEntry[] { _entry1 }, new LeaderContext(0, 0));
            _raftLog.append(_entry2);
            _logShipper.onNewEntries(1, 0, new RaftLogEntry[] { _entry2 }, new LeaderContext(0, 0));

            // then
            assertThat(_outbound.sentTo(_follower), Matchers.hasRaftLogEntries(asList(_entry1, _entry2)));
        }