Exemplo n.º 1
0
        public async Task delete_multiple_incoming_envelope()
        {
            var list = new List <Envelope>();

            for (var i = 0; i < 10; i++)
            {
                var envelope = ObjectMother.Envelope();
                envelope.Status = TransportConstants.Incoming;

                list.Add(envelope);
            }

            await ThePersistence.StoreIncoming(list.ToArray());

            var toDelete = new[] { list[2], list[3], list[7] };

            await ThePersistence.DeleteIncomingEnvelopes(toDelete);

            var stored = ThePersistence.AllIncomingEnvelopes();

            stored.Length.ShouldBe(7);

            stored.Any(x => x.Id == list[2].Id).ShouldBeFalse();
            stored.Any(x => x.Id == list[3].Id).ShouldBeFalse();
            stored.Any(x => x.Id == list[7].Id).ShouldBeFalse();
        }