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

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

                list.Add(envelope);
            }

            await ThePersistence.StoreOutgoing(list.ToArray(), 111);

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

            await ThePersistence.DeleteOutgoing(toDelete);

            var stored = ThePersistence.AllOutgoingEnvelopes();

            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();
        }
        public async Task delete_a_single_outgoing_envelope()
        {
            var list = new List <Envelope>();

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

                list.Add(envelope);
            }

            await ThePersistence.StoreOutgoing(list.ToArray(), 111);

            var toDelete = list[5];

            await ThePersistence.DeleteOutgoing(toDelete);

            var stored = ThePersistence.AllOutgoingEnvelopes();

            stored.Length.ShouldBe(9);

            stored.Any(x => x.Id == toDelete.Id).ShouldBeFalse();
        }