Disconnect() публичный Метод

public Disconnect ( System.Guid environmentId ) : void
environmentId System.Guid
Результат void
        public void StudioResourceRepository_Disconnect_PublishesRemoveEnvironmentMessage_ServerIsDisconnectedAndChildrenAreCollapsed()
        {
            //------------Setup for test--------------------------
            var aggregator = new Mock<EventAggregator>();
            IEnvironmentModel actualEnvironmentInvoked = null;
            aggregator.Setup(a => a.Publish(It.IsAny<RemoveEnvironmentMessage>())).Callback<object>(msg =>
            {
                var workSurfaceObject = (msg is RemoveEnvironmentMessage) ? (msg as RemoveEnvironmentMessage).EnvironmentModel : null;
                actualEnvironmentInvoked = workSurfaceObject;
            });

            EventPublishers.Aggregator = aggregator.Object;

            var environmentId = Guid.NewGuid();
            SetupEnvironmentRepo(environmentId);

            var repository = new StudioResourceRepository(GetTestData(), environmentId, _invoke);
            //------------Execute Test---------------------------
            var countBeforeDisconnect = repository.ExplorerItemModels[0].Children.Count;
            var isConnectedBeforeDisconnect = repository.ExplorerItemModels[0].IsConnected;
            repository.Disconnect(environmentId);
            var countAfterDisconnect = repository.ExplorerItemModels[0].Children.Count;
            var isConnectedAfterDisconnect = repository.ExplorerItemModels[0].IsConnected;
            //------------Assert Results-------------------------
            Assert.AreEqual(2, countBeforeDisconnect);
            Assert.AreEqual(0, countAfterDisconnect);
            Assert.AreEqual(true, isConnectedBeforeDisconnect);
            Assert.AreEqual(false, isConnectedAfterDisconnect);
            Assert.IsNull(actualEnvironmentInvoked);
        }
        public void StudioResourceRepository_Disconnect_ServerHasChildren_ServerIsDisconnectedAndChildrenAreCollapsed()
        {
            //------------Setup for test--------------------------
            var environmentId = Guid.NewGuid();
            SetupEnvironmentRepo(environmentId);

            var repository = new StudioResourceRepository(GetTestData(), environmentId, _invoke);
            //------------Execute Test---------------------------
            var countBeforeDisconnect = repository.ExplorerItemModels[0].Children.Count;
            var isConnectedBeforeDisconnect = repository.ExplorerItemModels[0].IsConnected;
            repository.Disconnect(environmentId);
            var countAfterDisconnect = repository.ExplorerItemModels[0].Children.Count;
            var isConnectedAfterDisconnect = repository.ExplorerItemModels[0].IsConnected;
            //------------Assert Results-------------------------
            Assert.AreEqual(2, countBeforeDisconnect);
            Assert.AreEqual(0, countAfterDisconnect);
            Assert.AreEqual(true, isConnectedBeforeDisconnect);
            Assert.AreEqual(false, isConnectedAfterDisconnect);
        }