public void add_all_open_loops_to_database(AddOpenLoopsCommand command)
        {
            var addedOpenLoops = new List<OpenLoop>();
            var unitOfWorkHandlerMock = new Mock<IUnitOfWork>();
            unitOfWorkHandlerMock.Setup(x => x.Add(It.IsAny<OpenLoop>())).Callback<OpenLoop>(x => addedOpenLoops.Add(x));

            var instance = new AddOpenLoopsHandler(unitOfWorkHandlerMock.Object);

            instance.Handle(command);

            Assert.Equal(command.OpenLoops, addedOpenLoops);
        }
        public void send_open_loops_command(AddOpenLoopsCommand command)
        {
            foreach (var openLoop in command.OpenLoops)
            {
                _instance.Title = openLoop.Title;
                _instance.Description = openLoop.Description;

                _instance.AddCurrent();
            }

            _instance.Save();

            Assert.Equal(1,_sendCommands.Count);
            Assert.True(_sendCommands.First() is AddOpenLoopsCommand);
            Assert.Equal(command.OpenLoops.Count,((AddOpenLoopsCommand)_sendCommands.First()).OpenLoops.Count);
            Assert.True(_closed);
        }