Exemple #1
0
        private void saveNewHistoryItem(IHistoryItem historyItem, int sequence, ISession session)
        {
            var metaData = _historyItemMetaDataMapper.MapFrom(historyItem);

            metaData.Sequence = sequence;
            _historyItemMetaDataRepository.Save(metaData, session);
        }
Exemple #2
0
        protected void CreateExistingItemAndMetaDataItem()
        {
            _existingItem = new HistoryItem("user", new DateTime(), A.Fake <ICommand>())
            {
                Id = "id"
            };
            _existingMetaDataItem = new HistoryItemMetaData {
                User = _existingItem.User, Id = "id", Command = new CommandMetaData {
                    Comment = "there"
                }
            };
            _existingItem.Command.Comment = "hi";
            _history = new List <IHistoryItem>
            {
                _existingItem
            };

            _existingHistoryItemMetaData = new List <HistoryItemMetaData>
            {
                _existingMetaDataItem
            };

            _historyManager = A.Fake <IHistoryManager>();

            A.CallTo(() => _historyManager.History).Returns(_history);
            A.CallTo(() => _historyItemMetaDataRepository.All(A <ISession> ._)).Returns(_existingHistoryItemMetaData);
            A.CallTo(() => _historyItemToHistoryItemMetaDataMapper.MapFrom(_existingItem)).Returns(_existingMetaDataItem);
        }