public async Task Sets_Error_to_NotFound_when_the_ID_does_not_exist()
        {
            var removeConnectionCommand = new RemoveConnectionCommand(999);
            await removeConnectionCommand.Process(virtualStudio);

            Assert.IsTrue(removeConnectionCommand.Error.Type == ErrorType.NotFound);
        }
        public async Task Removes_a_connection()
        {
            var removeConnectionCommand = new RemoveConnectionCommand(connection.Id);
            await removeConnectionCommand.Process(virtualStudio);

            Assert.IsTrue(virtualStudio.Connections.Count == 0);
        }
Пример #3
0
 private void RemoveConnectionExecute([NotNull] object toRemove)
 {
     if (toRemove == null)
     {
         throw new Exception("Connection to Remove can't be null");
     }
     if (toRemove is ConnectionModel connectionModel)
     {
         RemoveConnectionCommand removeConnectionCommand = new RemoveConnectionCommand(connectionModel, this);
         removeConnectionCommand.Execute();
         MyCommandManager.AddToList(removeConnectionCommand);
     }
 }