public void NavigationViewModel_UnitTest_AddEnvironmentWithDisconnectedNonLocalhost_DoesNotInitiateAutoConnect()
{
var localhost = new Mock<IEnvironmentModel>();
localhost.Setup(e => e.ID).Returns(Guid.Empty);
var envRepo = new Mock<IEnvironmentRepository>();
envRepo.Setup(e => e.All()).Returns(new List<IEnvironmentModel>());
envRepo.Setup(e => e.Source).Returns(localhost.Object);
var viewModel = CreateViewModel(envRepo.Object, new Mock<IResourceRepository>());
var otherConnection = new Mock<IEnvironmentConnection>();
otherConnection.Setup(e => e.StartAutoConnect()).Verifiable();
var other = new Mock<IEnvironmentModel>();
other.Setup(e => e.ID).Returns(Guid.NewGuid());
other.Setup(e => e.IsConnected).Returns(false);
other.Setup(e => e.CanStudioExecute).Returns(false);
other.Setup(e => e.Connection).Returns(otherConnection.Object);
viewModel.AddEnvironment(other.Object);
otherConnection.Verify(e => e.StartAutoConnect(), Times.Never(), "AddEnvironment started non-localhost auto-connect heartbeat.");
}