public void WhenPollIsCalledRetrievesANewCopyOfTheCruiseServerSnapshot() { CruiseServerSnapshot snapshot = new CruiseServerSnapshot(); mockServerManager.Setup(_manager => _manager.GetCruiseServerSnapshot()).Returns(snapshot).Verifiable(); monitor.Poll(); // deliberately called twice: should not go back to server on 2nd call Assert.AreSame(snapshot, monitor.CruiseServerSnapshot); Assert.AreSame(snapshot, monitor.CruiseServerSnapshot); }
public void WhenPollIsCalledRetrievesANewCopyOfTheCruiseServerSnapshot() { CruiseServerSnapshot snapshot = new CruiseServerSnapshot(); mockServerManager.ExpectAndReturn("GetCruiseServerSnapshot", snapshot); monitor.Poll(); // deliberately called twice: should not go back to server on 2nd call Assert.AreSame(snapshot, monitor.CruiseServerSnapshot); Assert.AreSame(snapshot, monitor.CruiseServerSnapshot); }