Exemplo n.º 1
0
        private IEnumerable <NoteShift> ConvertToNoteEntities(Notes notes, Currency currency)
        {
            foreach (var noteNominalCountPair in notes)
            {
                var noteEntity = new NoteShift
                {
                    Nominal  = noteNominalCountPair.Key,
                    Currency = currency.Name,
                    Count    = noteNominalCountPair.Value
                };

                yield return(noteEntity);
            }
        }
        public void Given_Notes_Should_RemoveNotesSuccessfuly()
        {
            var noteRepository       = GetNoteRepository();
            var notesBeforeInsertion = LoadNotes(noteRepository);

            var note = new NoteShift {
                Nominal = 1, Currency = Currency, Count = 10
            };

            noteRepository.Delete(note);

            var notesAfterInsertion = LoadNotes(noteRepository);

            Assert.IsTrue(notesAfterInsertion[1].Count == notesBeforeInsertion[1].Count - 10);
        }